Can a single TimePicker accept multiple time formats?

1 Answer 42 Views
TimePicker
Thomas
Top achievements
Rank 1
Iron
Thomas asked on 08 May 2024, 05:11 PM | edited on 09 May 2024, 01:39 PM

We need the TimePicker to retain all of its default behavior with the addition of accepting multiple format types when a user manually enters data. For example, if the user chooses a date from the popup it will show the date with the default format, but we want the user to also type in varying formats such as '7a' or '7pm'. Is it possible to add multiple accepted input formats to a TimePicker?



Required time formats:

 

  1. 7:00am
  2. 7:00a
  3. 7am
  4. 7a
  5. 7:00pm
  6. 7:00p
  7. 7pm
  8. 7p
  9. 19:00

 

1 Answer, 1 is accepted

Sort by
0
Wissam
Telerik team
answered on 10 May 2024, 12:24 PM

Hello, Thomas,

I have to say that this requirement is not available out of the box and requires a custom implementation.

Basically, the TimePicker component exposes the format property, therefore, you can set its value to a state variable and modify it based on the inputted value `event.value` from the onChange event, or from other properties of the onChange event.

For more information on setting the format, and handling the component in controlled mode, you can check the following articles:

If you have any further questions on this matter, please let me know.

Regards,
Wissam
Progress Telerik

Stay tuned by visiting our public roadmap and feedback portal pages! Or perhaps, if you are new to our Kendo family, check out our getting started resources!

Tags
TimePicker
Asked by
Thomas
Top achievements
Rank 1
Iron
Answers by
Wissam
Telerik team
Share this question
or