开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜