Skip to content
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

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

Open
cheeselemon opened this issue Dec 7, 2023 · 0 comments

Comments

@cheeselemon
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant