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

Disallow 3-digit year in kendo.dateParse()?

1 Answer 8 Views
Validation
This is a migrated thread and some comments may be shown as answers.
Troy
Top achievements
Rank 1
Troy asked on 17 Mar 2014, 04:39 PM
Wondering if there is a way to impose some sort of strict parsing so the following will be considered invalid instead of parsed into a future date:

kendo.parseDate('02/02/201', ['MM/dd/yy']); // Parsed into Sun Feb 02 2020 00:00:00 GMT-0800 (PST)

Thanks!

1 Answer, 1 is accepted

Sort by
0
Petur Subev
Telerik team
answered on 19 Mar 2014, 11:39 AM
Hello Troy,

The produced date result is just what is expected, you are passing three digits instead of two like you specified in the format. So it uses these two digits exactly after the slash

i.e.

kendo.parseDate('02/02/201', ['MM/dd/yy']);

The extra digit that you added is not needed for the format that you specified.

Kind Regards,
Petur Subev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Validation
Asked by
Troy
Top achievements
Rank 1
Answers by
Petur Subev
Telerik team
Share this question
or