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
If your date string format is 'ddd, MMM D YYYY' than dayjs.utc() creates a wrong object, but if you change the format to 'YYYY-MM-DD' it works correctly. Probably it's format() issue. Example:
dayjs.utc('Fri, Jan 28 2025').format('YYYY-MM-DD') => '2025-01-27'
dayjs.utc('2025-01-28').format('YYYY-MM-DD') => '2025-01-28'
Expected behavior
This command dayjs.utc('Fri, Jan 28 2025').format('YYYY-MM-DD') have to result in 2025-01-28
Information
Day.js Version 1.11.13
OS: MacOS
Browser Chrome 131
Time zone: GMT+2:00
The text was updated successfully, but these errors were encountered:
eugenkr
changed the title
Method utc() incorrectly parses the date string 'ddd, MMM D YYYY'
Method utc()/format() incorrectly parses the date string 'ddd, MMM D YYYY'
Jan 25, 2025
Describe the bug
If your date string format is 'ddd, MMM D YYYY' than
dayjs.utc()
creates a wrong object, but if you change the format to 'YYYY-MM-DD' it works correctly. Probably it'sformat()
issue. Example:Expected behavior
This command
dayjs.utc('Fri, Jan 28 2025').format('YYYY-MM-DD')
have to result in2025-01-28
Information
The text was updated successfully, but these errors were encountered: