开发者

jquery datepicker defaultDate going to 23/02/2016?

开发者 https://www.devze.com 2023-01-11 18:54 出处:网络
I\'ve added the detaultDate to my date开发者_如何转开发picker, it is getting the default date from a database, if i look at the source code of my page when ran the defaultDate looks fine but it goes t

I've added the detaultDate to my date开发者_如何转开发picker, it is getting the default date from a database, if i look at the source code of my page when ran the defaultDate looks fine but it goes to a completely different date, date format is dd/mm/yyyy.

$("#date").datepicker({
    changeMonth: false,
    changeYear: false,
    dateFormat: 'dd/mm/yyyy',
    defaultDate: '01/05/2010',
    duration: 'fast'
});

I've also tried:

var defaultDate = $( "#date" ).datepicker( "option", "defaultDate" );
$( "#date" ).datepicker( "option", "defaultDate", "01/05/2010" );

but instead of going to 01/05/2010 it goes to 23/02/2016.

It works fine if i use +7 or something but not a full date.

Any one got any ideas.

Thanks in advance.

J.


Shouldn't you be using yy instead of yyyy per the API? Can you provide a demo?

0

精彩评论

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