themesberg / flowbite-react

Official React components built for Flowbite and Tailwind CSS
https://flowbite-react.com
MIT License
1.82k stars 406 forks source link

fix(datepicker): fix the inconsistent weekday labels #1173

Closed markhker closed 8 months ago

markhker commented 8 months ago

Updating the WeekStart enum to be aligned with the values Javascript Date object uses allows to simplify the code and maintain compaitbility. Fixed the off-by-one error in the weekdays order.

BREAKING CHANGE: As the WeekStart enum changed order to be aligned with Javascript Date object, now you have to change your weekStart attribute to be -1, so for Monday you should put 1, instead of 2. But it wasn't working before as the values were incorrectly rendered in the first place.

fix #1044

Summarize the changes made and the motivation behind them.

Reference related issues using # followed by the issue number.

1044

If there are breaking API changes - like adding or removing props, or changing the structure of the theme - describe them, and provide steps to update existing code.

As the WeekStart enum changed order to be aligned with Javascript Date object, now you have to change your weekStart attribute to be -1, so for Monday you should put 1, instead of 2. But it wasn't working before as the values were incorrectly rendered in the first place.

vercel[bot] commented 8 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
flowbite-react ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 7, 2023 7:58pm
codecov[bot] commented 8 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (7461173) 99.54% compared to head (7c6dade) 97.36%. Report is 172 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1173 +/- ## ========================================== - Coverage 99.54% 97.36% -2.19% ========================================== Files 163 214 +51 Lines 6621 9065 +2444 Branches 401 533 +132 ========================================== + Hits 6591 8826 +2235 - Misses 30 239 +209 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

tulup-conner commented 8 months ago

@rluders Can you check this out?