-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Incorrect date parsing when format is 'MMM-YY' #1902
Comments
I have the same issue. Posting my dummy workaround here: function fixDayjs(input: string): Dayjs | undefined {
const date = dayjs(input)
if (date.isValid()) {
// https://github.com/iamkun/dayjs/issues/1902
// https://github.com/iamkun/dayjs/issues/1251
if (date.year() === 2001 && !input.split(' ').includes('2001')) {
return date.set('year', dayjs().year())
}
return date
}
return undefined
} |
I have another incorrect parsing bug Describe the bug Expected behavior Information
|
Would be fixed with pr #1914 |
Describe the bug
'Apr-22' is getting parsed as 22/04/2001, despite providing parse format as 'MMM-YY', https://jsfiddle.net/Lhv5fpyw/4/
Expected behavior
Date should be parsed correctly as 01/04/2022.
Information
The text was updated successfully, but these errors were encountered: