Jquery datepicker format date not working

后端 未结 12 2208
我在风中等你
我在风中等你 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

    Full example:

    In jsp:

    In script:

    function datepicker() {
    
      $("#datepicker").datepicker({
        showButtonPanel: true,
        dateFormat: 'yy-mm-dd',
        onSelect: function() {
            var dateObject = $('#datepicker').datepicker().val();
            alert(dateObject);
        }
       }
      );
    }
    

提交回复
热议问题