TimePicker default format when empty

1 Answer 29 Views
Date/Time Pickers
Robert
Top achievements
Rank 1
Robert asked on 21 Mar 2022, 06:12 PM

In the TimePicker control can you have it default to "hh:mm:ss" or "  :  :  "?

If I turn on, set dateInput to "true", it default to "hours:minutes:seconds".  Can this be changed?

1 Answer, 1 is accepted

Sort by
0
Georgi Denchev
Telerik team
answered on 24 Mar 2022, 11:08 AM

Hi, Robert,

You can modify the displayed dateInput value through the messages configuration:

let timePicker = $("#timepicker").kendoTimePicker({
    format: "HH:mm:ss",
  	dateInput: true
}).getKendoTimePicker();
  
  // Get a reference to the underlying dateInput widget and update its options.
  timePicker._dateInput.setOptions({
    messages: {
      hour: "hh",
      minute: "mm",
      second: "ss"
    }
  });

You can set the values to be whatever you want.

Dojo:

https://dojo.telerik.com/@gdenchev/OdUkIBUV 

Best Regards,
Georgi Denchev
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
Date/Time Pickers
Asked by
Robert
Top achievements
Rank 1
Answers by
Georgi Denchev
Telerik team
Share this question
or