Jquery datepicker format date not working

后端 未结 12 2120
我在风中等你
我在风中等你 2021-01-01 22:23

Here is my code:

$(function () {
    $(\"#datepicker\").datepicker({ dateFormat: \'DD-MM-YY\' });
});

And the datetime picker is shown, but

12条回答
  •  孤城傲影
    2021-01-01 23:11

    Setting the default format will solve the problem, this solution works for me while all above do not.

    $.datepicker.setDefaults({
         dateFormat: 'yy-mm-dd'
    });
    

    Source: Datepicker: Adding dateFormat is giving an error

提交回复
热议问题