jQuery UI: Date Picker
Date Picker
by Nibin George
HTML
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/themes/mint-choc/jquery-ui.css">
<div class="demo">
<p>Date: <input id="datepickerdep" type="text"></p>
<p>DateArr: <input id="datepickerarr" type="text"></p>
</div><!-- End demo -->
<div style="display: none;" class="demo-description">
<p>The datepicker is tied to a standard form input field. Focus on the input (click, or use the tab key) to open an interactive calendar in a small overlay. Choose a date, click elsewhere on the page (blur the input), or hit the Esc key to close. If a date is chosen, feedback is shown as the input's value.</p>
</div><!-- End demo-description -->
CSS
/*
Add custom styling or use existing jQuery UI themes
REFERENCE: jQuery UI themes, http://blog.jqueryui.com/
*/
JavaScript
jQuery("#datepickerdep").datepicker({
dateFormat: 'dd/mm/yy',
showOn: "both",
buttonImage: "images/calendar.png",
buttonImageOnly: true,
minDate:0,
maxDate : '+3M',
buttonText:"Click here to expand the calendar",
numberOfMonths : 2,
onClose: function( selectedDate ) {
$( "#datepickerarr" ).datepicker( "option", "minDate", selectedDate );
}
});
jQuery("#datepickerarr").datepicker({
dateFormat: 'dd/mm/yy',
showOn: "both",
buttonImage: "images/calendar.png",
buttonImageOnly: true,
maxDate: '+3M',
numberOfMonths:2,
buttonText:"click here to expand the calendar",
});