jquery datepicker returning a double year i.e. 05-01-20102010
$(functi开发者_C百科on() {
$(".datepicker").datepicker({
dateFormat: 'mm-dd-yy',
yearRange: 'c-70:c+10',
changeYear: true,
changeMonth: true,
numberOfMonths: 3,
showWeek: true,
firstDay: 1,
showOn: 'button',
buttonImage: "/images/scw.gif"; ?>',
buttonImageOnly: true
});
});
<input type='text' name='from_date' id='from_date' class='datepicker'>
<input type='text' name='to_date' id='to_date' class='datepicker'>
I was able to reproduce this with a recent version of jQuery with a date format of
{
dateFormat: 'mm-dd-yyyy'
}
Consider yy to be a full 4 digits year.
Edit: Is this the only instance of .datepicker
invocation in your script? Are there any calls? Is this using a custom locale thats not en? Do you have a link?
Are you sure its not yyyy
instead of yy
?
I had the same issue, it was because I called jQuery().datepicker()
twice.
精彩评论