Friday, May 10, 2024
 Popular · Latest · Hot · Upcoming
99
rated 0 times [  106] [ 7]  / answers: 1 / hits: 28825  / 8 Years ago, sat, april 2, 2016, 12:00:00

I am using the Date Range Picker plugin for bootstrap and I am trying to get the values in 24hour format. I have set the option timePicker24Hour: true but it still doesn't return it in 24 hour format.



This is my code:



$(#reportdatetime).daterangepicker({
timePicker: true,
timePicker24Hour: true,
timePickerIncrement: 30,
locale: {
format: 'MM/DD/YYYY h:mm'
}
});


Fiddle: https://jsfiddle.net/rdawkins/k67xfa1g/1/


More From » jquery

 Answers
38

Use the correct locale format.To display time in 24 hours format use the following -



$(#reportdatetime).daterangepicker({
timePicker: true,
timePicker24Hour: true,
timePickerIncrement: 30,
locale: {
format: 'MM/DD/YYYY H:mm'
}
});


working example : https://jsfiddle.net/Ly0jh5pz/2


[#62723] Thursday, March 31, 2016, 8 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
denzelc

Total Points: 637
Total Questions: 89
Total Answers: 88

Location: Liechtenstein
Member since Wed, Dec 8, 2021
2 Years ago
;