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

Formatting the date/time to include AM/PM seems to be broken

2 Answers 2368 Views
DateInput
This is a migrated thread and some comments may be shown as answers.
Len
Top achievements
Rank 1
Len asked on 20 Nov 2020, 07:23 PM

How do I format kendo date picker to include the AM/PM designator? A format string of "MM/dd/yyyy h:mm tt" renders as "11/20/2020 2:09 tt". The "tt" has not been replaced with AM or PM. This is for an angular 10 project with typescript. Kendo version "kendo-angular-dateinputs" is 4.4.0 according to my package.json. It was installed using the instructions here: https://www.telerik.com/kendo-angular-ui/components/dateinputs/.

 

 

2 Answers, 1 is accepted

Sort by
0
Len
Top achievements
Rank 1
answered on 20 Nov 2020, 07:29 PM
It's actually the kendo-datetimepicker component that I am having the issue with.
0
Martin Bechev
Telerik team
answered on 24 Nov 2020, 08:38 AM

Hello Len,

Thank you for the provided screenshots.

To include the AM/PM designator in the format, add 'a' at the end of the format string:

<kendo-datetimepicker [format]="'dd-MMM-yyyy HH:mm:ss a'">
</kendo-datetimepicker>

https://www.telerik.com/kendo-angular-ui/components/dateinputs/timepicker/formats/

I hope this helps.

Regards,
Martin
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
DateInput
Asked by
Len
Top achievements
Rank 1
Answers by
Len
Top achievements
Rank 1
Martin Bechev
Telerik team
Share this question
or