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

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

Merged
merged 1 commit into from
Dec 7, 2023

Conversation

markhker
Copy link
Contributor

@markhker markhker commented Dec 6, 2023

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.

Copy link

vercel bot commented Dec 6, 2023

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

Copy link

codecov bot commented Dec 6, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

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
@@            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     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@tulup-conner tulup-conner requested a review from rluders December 7, 2023 03:52
@tulup-conner
Copy link
Collaborator

@rluders Can you check this out?

Copy link
Collaborator

@SutuSebastian SutuSebastian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

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

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 themesberg#1044
@tulup-conner tulup-conner force-pushed the fix/datepicker-wrong-days branch from 7c6dade to ce13ac0 Compare December 7, 2023 19:56
@tulup-conner tulup-conner merged commit 770ab9d into themesberg:main Dec 7, 2023
2 of 3 checks passed
@github-actions github-actions bot mentioned this pull request Mar 29, 2024
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

Successfully merging this pull request may close these issues.

Inconsistent Datepicker Weekday Labels
3 participants