How to filter datetime column with 24h time format

2 posts, 1 answers
  1. Bulut
    Bulut avatar
    25 posts
    Member since:
    Dec 2016

    Posted 25 Oct 2018 Link to this post

    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!

  2. Answer
    Tsvetomir
    Admin
    Tsvetomir avatar
    757 posts

    Posted 26 Oct 2018 Link to this post

    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.
Back to Top