Display Bug: 24 hour formatted time

2 posts, 1 answers
  1. Greg
    Greg avatar
    8 posts
    Member since:
    Apr 2018

    Posted 07 May 2018 Link to this post

    I believe you have a bug in your software.

    I would like to display a 2 digit hour value, but want the time displayed in 24hour format.  So I'd like the hour zero padded if it is less than 10.

    Here are the value and format combinations I've used and how to recreate the bug:

    5/1/2018 1:11 => dd-mmm-yyyy h:mm => 01-may-2018 1:11 (works)

    5/1/2018 1:11 => dd-mmm-yyyy hh:mm => 01-may-2018 01:11 (works)

    5/1/2018 13:13 => dd-mmm-yyyy h:mm => 01-may-2018 13:13 (works)

    5/1/2018 13:13 => dd-mmm-yyyy hh:mm => 01-may-2018 01:13 (broken)

    Let me know if you have any questions.

    Greg

  2. Answer
    Neli
    Admin
    Neli avatar
    291 posts

    Posted 09 May 2018 Link to this post

    Hi Greg,

    In order to format a date in 24 hour format and have 2 digits for the hours you need to set the hours with uppercase, as it is below:
    format: "dd-mmm-yyyy HH:mm"
    On the following link you will find more information about the Date formats. 
    Here is a Dojo example where the described formatting is used and the hours are rendered correctly.

    Regards,
    Neli
    Progress Telerik
    Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top