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

Display Bug: 24 hour formatted time

1 Answer 56 Views
Spreadsheet
This is a migrated thread and some comments may be shown as answers.
Greg
Top achievements
Rank 1
Greg asked on 07 May 2018, 09:35 PM

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

1 Answer, 1 is accepted

Sort by
0
Accepted
Neli
Telerik team
answered on 09 May 2018, 10:15 AM
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.
Tags
Spreadsheet
Asked by
Greg
Top achievements
Rank 1
Answers by
Neli
Telerik team
Share this question
or