iamkun / dayjs

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

August month in spanish locale not working #2397

Open marianaibarra opened 1 year ago

marianaibarra commented 1 year ago

Describe the bug I'm trying to format a date with the month "agosto" (august), with the format YYYY-MM-DD and it gives an invalid date error. It works fine with other months except august.

Information

rataprens commented 1 year ago

same problem here, the only solution at the moment was removing the locale('es'), before any formatting

JNRivadeneira commented 5 months ago

I've been facing the same issue with 'Enero', 'Abril', 'Agosto' and 'Diciembre'. I suspect it's because they are a little different from its English translations. As @rataprens said, removing the locale('es') works, but in my case I was still receiving formatted data with locale('es'). To solve it I have used String + Format since I knew how the date data arrived. I hope it helps you too.