You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A customer is using a DatePicker in dropdown mode with the default mask. When entering a shorter year such as 5/17/20 it first looks right, but instead of using the current year it uses the year 1920.
Since the sample already specifies the format explicitly, if you actually use the two-digit format and (more importantly) mask the parsed values will actually be as expected:
At the moment, the Date Picker will only prefix values with 20- if the editing mask is the two-digit format and that's also static. Otherwise, the value as parsed is used to create a new date, which for new Date(21, 05, 15) will produce Jun 15 1921.
Note that this behavior will change once we go through a refactor of the Date Picker to use the new igxDateTimeEditor directive internally, which will handle two-digit values even in four digit format and will assume those are 2k years with threshold at 50 right now, though that's also a good feature request to make it controllable.
PS: Funny thing is JS Date is a bit inconsistent as new Date("Jun 15 21") will actually result in 2021 as the year :D
Description
A customer is using a DatePicker in dropdown mode with the default mask. When entering a shorter year such as 5/17/20 it first looks right, but instead of using the current year it uses the year 1920.
Steps to reproduce
Result
The created date is 06/15/1921
Expected result
The created date should be 06/15/2021
Attachments
Attach a sample if available, and screenshots, if applicable.
The text was updated successfully, but these errors were encountered: