I know this question has been asked on SO before, but I can't figure out what I'm missing. Here is a simple Fiddle.
The jquery:
var myDate = new Date(1978,2,11)
$('#datepicker').datepicker('setDate', myDate);
You have to initialize the datepicker first:
$('#datepicker').datepicker();
When you pass setDate, you are calling a method which assumes the datepicker has already been initialized on that object.
http://jsfiddle.net/tbYPf/4/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With