jquery.datePicker example: renderCalendar

< date picker home

The following example demonstrates the use of $().renderCalendar as introduced by jquery.datePicker.js.

This is a div with an id of "calendar-me".
Choose a month to render

Page sourcecode

$(function()
{
	// update the firstDayOfWeek when the day of week select changes
	$('#dow').bind(
		'change',
		function()
		{
			Date.firstDayOfWeek = Number(this.options[this.selectedIndex].value);
		}
	);
	// when the choose date form is submitted grab the chosen month and year
	// from the select elements and call renderCalendar...
	$('#chooseDateForm').bind(
		'submit',
		function()
		{
			var month = Number(this.month.options[this.month.selectedIndex].value);
			var year = Number(this.year.options[this.year.selectedIndex].value);
			
			$('#calendar-me').renderCalendar({month:month, year:year});
			
			return false;
		}
	);
});