The datepicker setDate
method, as described here is not working as expected.
The datepicker is always taking browsers current date. But I want to
set the current date of my choice.
$(target).datepicker({
dateFormat: $.datepicker.W3C,
closeText: 'X'
});
//set the current date
$(target).datepicker('setDate', currentDateObj);
//checking the current date.
alert($(target).datepicker('getDate'));
...where currentDateObj
is a javascript date object containing date 1st August 2009.
When I alert the "getDate" it alerts 1st august 2009, but when I open the datepicker it displays the browsers current date ie. 31st august 2009 .