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

Respect first day of the week setting #11651

Closed
spacedmonkey opened this issue Jun 8, 2022 · 8 comments · Fixed by #11732
Closed

Respect first day of the week setting #11651

spacedmonkey opened this issue Jun 8, 2022 · 8 comments · Fixed by #11732
Assignees
Labels

Comments

@spacedmonkey
Copy link
Contributor

Bug Description

WordPress has a setting for selecting the first day of the week. However, our date picker does not respect that.

Screenshot 2022-06-08 at 13 57 33
Screenshot 2022-06-08 at 13 57 18

See related WP core issue. #55826.

Expected Behaviour

Steps to Reproduce

Screenshots

Additional Context

  • Plugin Version:
  • WordPress Version:
  • Operating System:
  • Browser:
@swissspidy
Copy link
Collaborator

Oh good call. Looks like there's no explicit setting for first day of the week (wojtekmaj/react-calendar#10), but only a calendarType option:

const toCalendarType = (weekStartDay) =>
  weekStartDay === 0 ? 'US' : 'ISO 8601'
}

Maybe that works?

@spacedmonkey
Copy link
Contributor Author

@spacedmonkey
Copy link
Contributor Author

There is a PR on the gutenberg side - WordPress/gutenberg#41648

@swissspidy
Copy link
Collaborator

Gutenberg uses a different library for the date picker, so what works for them probably does not work for us.

@spacedmonkey
Copy link
Contributor Author

Gutenberg uses a different library for the date picker, so what works for them probably does not work for us.

I know that 😉 Just sharing as this might help with our solution. There maybe also be parts of code, we need to consider for our solution.

@swissspidy swissspidy added the P2 Should do soon label Jun 10, 2022
@spacedmonkey spacedmonkey self-assigned this Jun 17, 2022
@felipebochehin87
Copy link

@swissspidy morning!

While testing this PR (#11732) I noticed that Saturday, Sunday and Monday can be set as 1st days, but Friday can't. Is this something that we need to fix in this PR or can we create a new one for this scenario?

@swissspidy
Copy link
Collaborator

Nothing we can fix. The calendar we use does not support it.

@felipebochehin87
Copy link

Thanks! So the PR is approved.

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

Successfully merging a pull request may close this issue.

3 participants