Ok i have a <input id="has-assigned-date">, I want to set or put the default value. The value from the db when fetched it should be on the input box this will occur on page ready. Sorry for the poor english…
Here’s my code:
$("#has-assigned-date").datepicker({
minDate: -20,
maxDate: "+12M +10D" ,
dateFormat: "yy-mm-dd",
defaultDate: dd,
setDate: (def[2] - 1) + "/" + def[1] + "/" + def[0]});
Please use the keyword ‘option’, and set the date as a new Date object.