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
Describe the bug
Executing dayjs("2022-99-99", "YYYY-MM-DD") does result in a valid date.
Expected behavior
Date should be invalid
Information
Day.js Version: 1.11.2
OS: Arch, up to date
Browser: Firefox version 101.0
Time zone: CEST
The issue likely affects other possible format strings aswell (e.g. seconds > 60 (in the context of timestamps)), but I have only experienced and tested it with the above format.
The text was updated successfully, but these errors were encountered:
That is not an error, but by design (see my comments in pr #1914).
If you want the result to be 'Invalid Date' then use the strict option ('true' as 3rd parameter).
Without strict mode, dayjs behaves like the javascript Date object using 'overflow'.
Describe the bug
Executing
dayjs("2022-99-99", "YYYY-MM-DD")
does result in a valid date.Expected behavior
Date should be invalid
Information
1.11.2
Arch, up to date
101.0
The issue likely affects other possible format strings aswell (e.g. seconds > 60 (in the context of timestamps)), but I have only experienced and tested it with the above format.
The text was updated successfully, but these errors were encountered: