Date Picker ParseFormat for MM-dd-yyyy

5 posts, 1 answers
  1. Diana
    Diana avatar
    5 posts
    Member since:
    Jan 2016

    Posted 21 Jun Link to this post

    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.

  2. Preslav
    Admin
    Preslav avatar
    225 posts

    Posted 23 Jun Link to this post

    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.
  3. Diana
    Diana avatar
    5 posts
    Member since:
    Jan 2016

    Posted 23 Jun in reply to Preslav Link to this post

    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

  4. Answer
    Preslav
    Admin
    Preslav avatar
    225 posts

    Posted 26 Jun Link to this post

    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.
  5. Diana
    Diana avatar
    5 posts
    Member since:
    Jan 2016

    Posted 26 Jun in reply to Preslav Link to this post

    Thank you Preslav! That makes sense. 
Back to Top