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

fix: weekday check function for other locales

Open cheeselemon opened this issue 1 year ago • 1 comments

Fixing issue #150 , #221

Screenshot 2023-12-07 at 6 57 08 PM

Problem:

  • Calendar doesn't show previous month, all months start with 1.

Reason:

  • This is due to getNumberOfDay being stuck at number = 0, when delcaring dayjs.locale() other than "en" globally outside library.

The Fix:

  • Instead of using hard-coded weekday string array ["Sunday", ... "Saturday"], a function is created to specifically use previously set locales.

cheeselemon avatar Dec 07 '23 09:12 cheeselemon