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

Date Picker ParseFormat for MM-dd-yyyy

4 Answers 828 Views
Date/Time Pickers
This is a migrated thread and some comments may be shown as answers.
Diana
Top achievements
Rank 1
Diana asked on 21 Jun 2017, 09:24 PM

Anyone knows why MM-dd-yyyy format is being parsed to retain the first 2 digits of the year instead of last 2 digits?

Parsing 06-21-2017 to a mm-dd-yy format results in 06-21-20.

Example: http://dojo.telerik.com/unOJA

Any guidance is much appreciated.

4 Answers, 1 is accepted

Sort by
0
Preslav
Telerik team
answered on 23 Jun 2017, 07:12 AM
Hi Diana,

At this stage, we are experiencing issues with the Dojo code services. That said, I was not able to check the provided code snippet.

However, I was not able to replicate the problem on my side, pleaser refer to this Jsfiddle:

Regards,
Preslav
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Diana
Top achievements
Rank 1
answered on 23 Jun 2017, 05:59 PM

Preslav,

Please take a look at the Dojo again and try 06-21-2017. Click outside and see the parsed value as being 06-21-20.

Thank you!

Diana

0
Accepted
Preslav
Telerik team
answered on 26 Jun 2017, 12:56 PM
Hello Diana,

Thank you for elaborating on the issue.

This behavior is expected due to the fact that when the user manually inputs the date, the format is parsing a string. On the other hand, when the user picks a date from the calendar, the format is parsing a date object.

That said, a possible workaround might be setting the dateInput configuration to true.
For example, check the modified Dojo: http://dojo.telerik.com/unOJA/3


Regards,
Preslav
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Diana
Top achievements
Rank 1
answered on 26 Jun 2017, 10:43 PM
Thank you Preslav! That makes sense. 
Tags
Date/Time Pickers
Asked by
Diana
Top achievements
Rank 1
Answers by
Preslav
Telerik team
Diana
Top achievements
Rank 1
Share this question
or