This method changes the current date and redraws the calendar. By default, will execute the update callback.
This methods required parameter can be a String or a Date object.
If the parameter is a date object, the current date will be set to new the parameter date.
As a String, the allowed paramater values are:
This method accepts a second optional parameter. When passed as boolean true, this method will not execute the update callback.
This method returns the modified current date.
var options = ({
month:11,
year:2009,
day: 1
});
var Cal = new scal('samplecal',updateelement,options);
Cal.setCurrentDate('monthup'); // Changes the current date from 11-01-2009 to 12-01-2009
Cal.setCurrentDate('yearup'); // Changes the the current date from 12-01-2009 12-01-2010
Cal.setCurrentDate('init'); // Changes the current date to the original date: 11-01-2009
Cal.setCurrentDate('monthdown'); // Changes the current date from 11-01-2009 to 10-01-2009
Cal.setCurrentDate('yeardown'); // Changes the current date from 10-01-2009 to 10-01-2008
var d = new Date(2007,10,1);
Cal.setCurrentDate(d); // Changes the current date to 11-01-2007Stops event observations related to scal, obliterates the scal instance, removes elements created by scal, and generally frees up memory.
None
None
Cal.destroy();If the calendar is visible, calling this function makes it invisible. Amazingly, the reverse is also true.
None
None
Cal.toggleCalendar();Retrieves the calendar day element for the specified date.
Date object of the the specified element to retrieve.
The calendar element for the specified date.
var dayElement = Cal.getElementByDate(new Date('December 12, 2008'));Retrieves the calendar day elements for the specified week.
Number of the week to retrieve elements for.
Array of calendar day elements for the specified week.
var weekElements = Cal.getElementsByWeek(1);Retrieves the selected day for the current calendar.
None
The calendar element for the selected day.
var selected = Cal.getSelectedElement();Retrieves the today element for the current calendar.
None
The calendar element for today's element.
var today = Cal.getTodaysElement();Retrieves the date object for the specified calendar day element.
Extended element in the current calendar view.
Date object for the specified element.
var dayTwo = Cal.getDateByElement(weekElements[1]); Displays the calendar.
None
None
Hides the calendar.
None
None
Returns boolean indicating the display status of the calendar.
None
true/false