This is a migrated thread and some comments may be shown as answers.

How to filter datetime column with 24h time format

1 Answer 77 Views
This is a migrated thread and some comments may be shown as answers.
Bulut
Top achievements
Rank 1
Bulut asked on 25 Oct 2018, 05:41 PM

I am trying to make my filter time in 24h format but didn't work whatever I ve tried.

 

Here is an example dojo.

 

I want my filter time to show 24h format as well instead of 12h format.

Thank you!

1 Answer, 1 is accepted

Sort by
0
Accepted
Tsvetomir
Telerik team
answered on 26 Oct 2018, 10:06 AM
Hi Bulut,

The filterable.cell property specifies options for the filter header cell when filter mode is set to 'row'. In the provided Dojo sample, the filterable mode is "menu", which is set by default.

That being said, in the filterable property of the Kendo UI Grid column, you can initialize a widget and set its properties as desired. You can set the formatting as follows: 

filterable: {
                ui: function(element){
                  element.kendoDateTimePicker({
                     timeFormat: "HH:mm",
                    format: "{0:MM/dd/yyyy HH:mm}",
                    parseFormats: ["MM/dd/yyyy HH:mm"]
                  });
                }
              }

For your convenience, I have modified the provided Dojo sample to reflect the abovementioned suggestion.

https://dojo.telerik.com/OjAnuGOR

If additional questions arise, feel free to contact us again.


Kind regards,
Tsvetomir
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
Grid
Asked by
Bulut
Top achievements
Rank 1
Answers by
Tsvetomir
Telerik team
Share this question
or