Changing minDate option in JQuery DatePicker does nothing
Posted
by futureelite7
on Stack Overflow
See other posts from Stack Overflow
or by futureelite7
Published on 2010-03-18T06:48:43Z
Indexed on
2010/03/18
6:51 UTC
Read the original article
Hit count: 774
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);
© Stack Overflow or respective owner