Reputation: 688
JQuery UI datepicker widget is not displaying the date correctly it looks like this:
the input code looks like this:
<input type="text" value="" name="DateTo" id="DateTo" class="hasDatepicker">
I add datepicker simply by calling $('#DateTo').datepicker();
Anyone have an idea why it does not display the dates correctly?
Upvotes: 0
Views: 440
Reputation: 3449
set the dates:
var qDates = '2009-11-01',
dateParts = qDates.match(/(\d+)/g)
realDate = new Date(dateParts[0], dateParts[1] - 1, dateParts[2]);
$('#datePicker').datepicker({ dateFormat: 'yy-mm-dd' });
$('#datePicker').datepicker('setDate', realDate);
Upvotes: 3