Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to show 24 hour time picker in tempusdominus plugin

I'm using this plugin https://tempusdominus.github.io/bootstrap-4/

to insert a datetimepicker. I would display time picker showing time in 24 hours (i.e not showing 02:00 PM but 14:00). There a way to perform this, with tempusdominus plugin. I follow the guide, but it still display time with AM and PM. Thanks.

like image 649
Linda Avatar asked Jul 14 '18 09:07

Linda


2 Answers

In your jQuery you should set format from LT to

format:'HH:mm';

If you want the date and time just set

 format: 'dddd, MMMM Do YYYY, HH:mm';

You can find all your formats at Formats

like image 142
Skygater Avatar answered Nov 02 '22 13:11

Skygater


I had the same problem and I changed the code to:

    $('.datePicker').datetimepicker({
        format: 'DD/MM/YYYY, HH:mm',
    });

and it works now

like image 6
Esty Shlomovitz Avatar answered Nov 02 '22 13:11

Esty Shlomovitz