I have this jQuery datepicker code that initially set the minDate of the datepicker. After a user selects a starting date, I used the option attribute to change the minDate of the datepicker, but nothing happens. What did I do wrong and how should I make it work?
Datepicker init code:
$(function () {
$('#starttime,#endtime,#validity').datepicker({
numberOfMonths: [1, 2],
buttonImageOnly: true,
showAnim: 'slideDown',
buttonImage: '../images/cal.gif',
beforeShow: customRange,
dateFormat: "dd-mm-yy",
firstDay: 1,
changeFirstDay: false
});
});
Datepicker change minimum date code:
var startdate = new Date(2010,4-1,
4-1,0,0,0);
$("#endtime").datepicker('option','minDate',startdate);