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

fix(localize): parseDate by default to 2000 instead of 1900 when date is below 49 #2148

Merged
merged 1 commit into from
Nov 29, 2023

Conversation

gerjanvangeest
Copy link
Member

The date picker Autofill the wrong date starting from 1900 year when trying to enter manually for e.g. -
12/12/1 => it auto completes to 12/12/1901
12/12/2 => it auto completes to 12/12/1902... etc

So in the code 12/12/1 resulted in new Date(1, 11, 12)) which gave 12/12/1901.
This fix adds 2000 to all numbers below 50.

Copy link

changeset-bot bot commented Nov 28, 2023

🦋 Changeset detected

Latest commit: b5d900c

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@lion/ui Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@gerjanvangeest gerjanvangeest merged commit 9b5edf3 into master Nov 29, 2023
4 checks passed
@gerjanvangeest gerjanvangeest deleted the fix/parseDate-year branch November 29, 2023 09:52
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

Successfully merging this pull request may close these issues.

2 participants