jQuery UI DatePicker - Change Date Format

前端 未结 28 1805
后悔当初
后悔当初 2020-11-21 16:39

I am using the UI DatePicker from jQuery UI as the stand alone picker. I have this code:

And the

28条回答
  •  余生分开走
    2020-11-21 17:15

    dateFormat

    The format for parsed and displayed dates. This attribute is one of the regionalisation attributes. For a full list of the possible formats see the formatDate function.

    Code examples Initialize a datepicker with the dateFormat option specified.

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

    Get or set the dateFormat option, after init.

    //getter
    var dateFormat = $( ".selector" ).datepicker( "option", "dateFormat" );
    //setter
    $( ".selector" ).datepicker( "option", "dateFormat", 'yy-mm-dd' );
    

提交回复
热议问题