0
votes

Using JQuery, I want to load startDate in DatePicker.

$('#myId').datepicker({ minDate: '-100D', maxDate: '+145D', startDate: new Date(2011,0,4) });

where myId is an input field. MinDate, maxDate both are working fine but startDate is not working. Currently, it is showing today's date.

3

3 Answers

2
votes

It doesn't look like startDate is an option for the jqueryUI date picker: Datepicker (Click options tab). I think you want defaultDate

2
votes

You are looking for defaultDate, and this is actually jQuery UI, not just jQuery.

Example:

$('#myId').datepicker({ minDate: '-100D', maxDate: '+145D', defaultDate: new Date(2011,0,4) });
1
votes

The property yo uare trying to set is actually called 'defaultDate' not 'startDate'. Also, keep in mind, that 'defaultDate' should be in range (minDate, maxDate).