calendar.js revision e459c407a404c834e5f9759744d1a134d820d41b
0N/AYUI({
2362N/A base: '../../../../build/',
0N/A filter: 'RAW',
0N/A debug: true
0N/A}).use('calendar-base', function(Y) {
0N/A
2362N/A
0N/AY.CalendarBase.CONTENT_TEMPLATE = '<div class="yui3-g {calendar_pane_class}" id="{calendar_id}">' +
2362N/A '{header_template}' +
0N/A '<div class="yui3-u-1-3">' +
0N/A '{calendar_grid_template}' +
0N/A '</div>' +
0N/A '<div class="yui3-u-1-3">' +
0N/A '{calendar_grid_template}' +
0N/A '</div>' +
0N/A '<div class="yui3-u-1-3">' +
0N/A '{calendar_grid_template}' +
0N/A '</div>' +
0N/A '<div class="yui3-u-1-3">' +
0N/A '{calendar_grid_template}' +
2362N/A '</div>' +
2362N/A '<div class="yui3-u-1-3">' +
2362N/A '{calendar_grid_template}' +
0N/A '</div>' +
0N/A '<div class="yui3-u-1-3">' +
0N/A '{calendar_grid_template}' +
0N/A '</div>' +
0N/A '<div class="yui3-u-1-3">' +
0N/A '{calendar_grid_template}' +
0N/A '</div>' +
0N/A '<div class="yui3-u-1-3">' +
0N/A '{calendar_grid_template}' +
0N/A '</div>' +
0N/A '<div class="yui3-u-1-3">' +
0N/A '{calendar_grid_template}' +
0N/A '</div>' +
0N/A '<div class="yui3-u-1-3">' +
0N/A '{calendar_grid_template}' +
0N/A '</div>' +
0N/A '<div class="yui3-u-1-3">' +
0N/A '{calendar_grid_template}' +
0N/A '</div>' +
0N/A '<div class="yui3-u-1-3">' +
0N/A '{calendar_grid_template}' +
0N/A '</div>' +
0N/A '</div>';
0N/A
0N/A
0N/A var calendar = new Y.CalendarBase({
0N/A contentBox: "#mycalendar",
0N/A height:'200px',
0N/A width:'600px',
0N/A showPrevMonth: true,
0N/A showNextMonth: true,
0N/A date: new Date(2029, 11)}).render();
0N/A
0N/A
10N/A var curDate = calendar.get("date");
10N/A
10N/A calendar.set("headerRenderer", function (curDate) {
10N/A var ydate = Y.DataType.Date,
0N/A output = ydate.format(curDate, {format: "%B, %Y"}) +
0N/A " &mdash; " +
0N/A ydate.format(ydate.addMonths(curDate, calendar._paneNumber-1), {format: "%B, %Y"});
0N/A console.log("Output: " + output);
0N/A return output;
0N/A });
0N/A
0N/A Y.one("#updateCalendar").on('click', function () {
0N/A curDate = new Date(1950 + Math.round(Math.random()*100),
0N/A Math.round(Math.random()*12.49), 1);
0N/A calendar.set('date', curDate);
0N/A Y.one("#currentDate").setContent(calendar.get("date").toString());
0N/A });
0N/A
0N/A Y.one("#togglePrevMonth").on('click', function () {
0N/A calendar.set('showPrevMonth', !(calendar.get("showPrevMonth")));
0N/A });
0N/A Y.one("#toggleNextMonth").on('click', function () {
0N/A calendar.set('showNextMonth', !(calendar.get("showNextMonth")));
0N/A });
0N/A
0N/A Y.one("#toggleSelection").on('click', function () {
0N/A calendar.select(new Date (curDate.getFullYear(), curDate.getMonth(), 23));
0N/A });
0N/A
0N/A});
0N/A
0N/A