Can I change the date format in the time selection method?

I found an excellent timing based on jQuery-ui http://trentrichardson.com/examples/timepicker/ , but suddenly realized that I could not change the date format ... I tried something like this:

jQuery('.datetimepicker').datetimepicker({
        timeFormat: 'HH:mm'
    }).formatDate('yy-mm-dd');

Can someone show an example?

+5
source share
7 answers

You can use the code:

jQuery('.datetimepicker')
    .datetimepicker({ 
        dateFormat: 'yy-mm-dd', 
        timeFormat: 'HH:mm' 
     });
+5
source

Try the following:

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

 $.datepicker._defaults.dateFormat = "yy-mm-dd";
+2
source

, , dateFormat API datepicker

,

jQuery('.datetimepicker').datetimepicker({
        timeFormat: 'HH:mm',
        dateFormat: "yy-mm-dd"
});
+2

, . , API

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

"" url. u

+1
source

Try the following:

JQuery ('DateTimePicker'). DateTimePicker ({dateFormat: "D MM d, yy"});

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

0
source

Possibly, this is an example of a link. extracting from this example may not be a problem, I think :)

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

0
source

Just add that none of the above worked for me, but the following:

$(".datetimepicker").DateTimePicker({
    dateFormat: 'yyyy-mm-dd'
});

Hi

Liam

0
source

All Articles