Is it possible to change date format in date time picker?

后端 未结 7 715
刺人心
刺人心 2021-01-13 03:12

I found a great date time picker based on jQuery-ui http://trentrichardson.com/examples/timepicker/, but suddenly realized that i can\'t modify date format... Tried somethin

相关标签:
7条回答
  • 2021-01-13 03:38

    You can use the code:

    jQuery('.datetimepicker')
        .datetimepicker({ 
            dateFormat: 'yy-mm-dd', 
            timeFormat: 'HH:mm' 
         });
    
    0 讨论(0)
  • 2021-01-13 03:38

    Yes it is possible, have a look at the dateFormat option in the API Documentation for the datepicker

    This will work,

    jQuery('.datetimepicker').datetimepicker({
            timeFormat: 'HH:mm',
            dateFormat: "yy-mm-dd"
    });
    
    0 讨论(0)
  • 2021-01-13 03:39

    yes it is possible to format the date. Refer the link given in this API

    $.datepicker.formatTime(format, timeObj, options)
    

    Refer the Formatting tab in this url. At the bottom of page u find the option to format a date

    0 讨论(0)
  • 2021-01-13 03:45

    Try this:

    This will set the date format to "yy-mm-dd"

     $.datepicker._defaults.dateFormat = "yy-mm-dd";
    
    0 讨论(0)
  • 2021-01-13 03:48

    Try this :

    jQuery('.datetimepicker').datetimepicker({ dateFormat: "D MM d, yy" });

    and see this for more documentation : http://trentrichardson.com/examples/timepicker/#tp-formatting

    0 讨论(0)
  • 2021-01-13 03:48

    POSSIBLE, heres an example link. extracting from this example souldnt be a problem i guess :)

    http://jqueryui.com/resources/demos/datepicker/date-formats.html

    0 讨论(0)
提交回复
热议问题