changing minDate option in JQuery DatePicker not working
datepicker, jquery-ui
Solution
Draco,
You can do it like this:
$("#datePickerId").datepicker(
{ dateFormat: 'DD, d MM yy',
minDate: new Date(2009, 10 - 1, 25), // it will set minDate from 25 October 2009
showOn: 'button',
buttonImage: '../../images/calendar.gif',
buttonImageOnly: true,
hideIfNoPrevNext: true
}
);
remember to write -1 after month (ex. for june is -> 6 -1)
Problem
I have declared a date picker instance as follows: ``` $("#datePickerId").datepicker( { dateFormat: 'DD, d MM yy', minDate: 0, showOn: 'button', buttonImage: '../../images/calendar.gif', buttonImageOnly: true, hideIfNoPrevNext: true } ); ``` I now want to change to the minDate option so I do this: ``` $('#datePickerId').datepicker('option', 'minDate', 3); ``` But nothing happens. Was I suppose to do anything else? What other possible causes could there be?