DateTimePicker (and other date inputs) - support for parseFormats config?

1 Answer 23 Views
DateInput DatePicker DateTimePicker
Alexa
Top achievements
Rank 1
Alexa asked on 08 Jul 2024, 10:05 PM

Hello,

Does anyone know if there are plans to have a configuration for KendoReact date inputs that work similarly to Kendo UI for jQuery's parseFormats?

I am using a DateTimePicker and have the following requirements:

  1. The time must be formatted using military time ie HH:MM
  2. The user must be able to manually type the year as a two OR four digit year 
  3. On blur, the year ought to display as a four digit year (I don't make the rules)

I have been able to accomplish the second point in a DatePicker by 1. Not specifying a format and 2. Adding some logic in the onBlur event so that a 2-digit year is replaced with a 4-digit year.

I have been scratching my head as to how to accomplish this with the DateTimePicker - I need to specify the format for the time format, and that is constraining the year length.

 

I'm sure I will find a solution eventually, but having an option like parseFormats would be really helpful in this case. Or maybe there is a different config I can use for this?

 

Thanks!

 

Alexa
Top achievements
Rank 1
commented on 09 Jul 2024, 08:48 PM

If anyone is interested, I did find a solution: I set the format to "MM/dd/y HH:mm". I just had to read the kendo-intl date formatting docs a little more closely.

Here's an example of what I did. I realize it's not working 100% (cannot set value using calendar, but my actual project has some additional onChange handling that takes care of that).

My question still stands, however, about the possibility of a "parseFormats" prop in the future.

 

1 Answer, 1 is accepted

Sort by
0
Filip
Telerik team
answered on 10 Jul 2024, 01:58 PM

Hi, Alexa,

I am glad to hear that you have managed to find a solution and thank you for sharing it with the community. As for the `parseFormats` prop, we have a logged feature request in our feedback portal, you can track its progress here:

https://feedback.telerik.com/kendo-react-ui/1472977-add-parseformats-option-to-the-kendoreact-dateinputs

I have added your vote to increase the odds of implementing the props in the future. 

Regards,
Filip
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
DateInput DatePicker DateTimePicker
Asked by
Alexa
Top achievements
Rank 1
Answers by
Filip
Telerik team
Share this question
or