-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Make date picker respect site's 'Week Starts On' setting #41648
Conversation
Size Change: +69 B (0%) Total Size: 1.24 MB
ℹ️ View Unchanged
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice enhancement @noisysocks, gives the publishing interface a good additional bit of polish 👍
Works well in testing for me:
Monday | Sunday | Wednesday (this hurts my eyes, but works!) |
---|---|---|
Just left an optional nit about whether we should use optional chaining 😄, but this LGTM! ✨
Allows the block editor to respect the site's Week Starts On setting by defining `i10n.startOfWeek` when initialising the `@wordpress/date` module. This is a backport of WordPress/gutenberg#41648. See #56467. Props andrewserong. Built from https://develop.svn.wordpress.org/trunk@54079 git-svn-id: http://core.svn.wordpress.org/trunk@53638 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Allows the block editor to respect the site's Week Starts On setting by defining `i10n.startOfWeek` when initialising the `@wordpress/date` module. This is a backport of WordPress/gutenberg#41648. See #56467. Props andrewserong. Built from https://develop.svn.wordpress.org/trunk@54079 git-svn-id: https://core.svn.wordpress.org/trunk@53638 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Allows the block editor to respect the site's Week Starts On setting by defining `i10n.startOfWeek` when initialising the `@wordpress/date` module. This is a backport of WordPress/gutenberg#41648. See #56467. Props andrewserong. git-svn-id: https://develop.svn.wordpress.org/trunk@54079 602fd350-edb4-49c9-b593-d223f7449a82
Added the Needs Dev Note label in case this needs a dev note (either individual or as part of a "misc" dev note) for WP 6.1 release. |
I don't think so, it's a bug fix. |
Allows the block editor to respect the site's Week Starts On setting by defining `i10n.startOfWeek` when initialising the `@wordpress/date` module. This is a backport of WordPress/gutenberg#41648. See #56467. Props andrewserong. Built from https://develop.svn.wordpress.org/trunk@54079
Allows the block editor to respect the site's Week Starts On setting by defining `i10n.startOfWeek` when initialising the `@wordpress/date` module. This is a backport of WordPress/gutenberg#41648. See #56467. Props andrewserong. git-svn-id: https://develop.svn.wordpress.org/trunk@54079 602fd350-edb4-49c9-b593-d223f7449a82
What?
Fixes #41078.
Makes the calendar used in the post publish date picker respect the Week Starts On setting that WordPress has.
Why?
Different locales have different conventions around when the first day of the week is. Also some weirdos like me have a strong preference on the matter.
How?
The library we use for the calendar,
react-dates
, already supports this setting, so I'm just passing the setting along from PHP to the component via@wordpress/date
settings which is where we put all the other locale specific date settings.Testing Instructions
Screenshots or screencast
Kapture.2022-06-10.at.15.45.03.mp4