Jquery datepicker format date not working

后端 未结 12 2213
我在风中等你
我在风中等你 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 22:58

    Depending on the version of datepicker being used, the correct format may be:

    $('#datepicker').datepicker({ format: 'yyyy-mm-dd' });
    

提交回复
热议问题