iamkun / dayjs

⏰ Day.js 2kB immutable date-time library alternative to Moment.js with the same modern API
https://day.js.org
MIT License
46.85k stars 2.29k forks source link

Error parsing string #933

Open acba opened 4 years ago

acba commented 4 years ago

Describe the bug Just found this bug on my app, dayjs can't parse the string right, even when i'm forcing the format. I'm trying to parse the string '02022000'. Got working using something to separate the numbers.

image

Just used the devtools on https://day.js.org/ to get the image above

Expected behavior I would expect to use dayjs('02022000', 'DDMMYYYY').format('DD/MM/YYYY') and get 02/02/2000

image

Information

iamkun commented 4 years ago

Please check https://day.js.org/docs/en/parse/string-format and make sure you have enabled CustomParseFormat plugin.