Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LionInputDate: 3-digit year is accepted as valid #2483

Open
radioflyer042104 opened this issue Feb 27, 2025 · 0 comments
Open

LionInputDate: 3-digit year is accepted as valid #2483

radioflyer042104 opened this issue Feb 27, 2025 · 0 comments

Comments

@radioflyer042104
Copy link

Expected Behavior

Dates with 3-digit years would be invalidated

Date values like "27/12/202" will be invalidated. This happens in the default parser (@lion/ui/components/localize/src/date/parseDate.js).

parseDate.js line 72:
const parsedDate = new Date(new Date(correctedYear, month - 1, day));

Passing a dateString, "27/12/202", to the parser will return a new Date (27-12-0202).

This might also be a bug because, by looking at the code of the default parser, it seems that the intent was to only accept dates from 1950 onwards.

Actual Behavior

Date values like "27/12/202" are accepted and a new Date (27-12-0202) is returned by the default parser.

Additional context

Using @lion/ui: 0.7.8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant