react-tailwindcss-datepicker icon indicating copy to clipboard operation
react-tailwindcss-datepicker copied to clipboard

Calendar not showing previous month when using different dayjs.locale()

Open cheeselemon opened this issue 1 year ago • 0 comments

If you declare dayjs.locale() somewhere alongside using this library, the weekday matching function below will fail:

react-tailwindcss-datepicker/src/helpers/index.ts

Line 174 in bf063fe

["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"].forEach( because the date argument provided using getFirstDayInMonth(date).ddd will return what was defined through dayjs.locale() other than "en" will return non english weekday string, thus won't match anything so the variable number will always be zero.

I'm implementing a fix, and will update with a pull request.

See related: #150

cheeselemon avatar Dec 07 '23 09:12 cheeselemon