-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
[pickers] Support localized start of the week on AdapterLuxon
#10964
[pickers] Support localized start of the week on AdapterLuxon
#10964
Conversation
Deploy preview: https://deploy-preview-10964--material-ui-x.netlify.app/ Updated pages: |
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
return value.startOf( | ||
'week', | ||
// @ts-ignore | ||
{ useLocaleWeeks: true }, |
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.
The types do not include the new APIs yet, I can remove those comment later.
For older versions of Luxon, this param should be ignored and the behavior should just be like before.
I think we can bump the minimal version of Luxon in v8 to unify everyones behavior, but keep supporting older one in v7 to avoid forcing a very-recent version.
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.
just a nit ... LGTM!
docs/data/migration/migration-pickers-v6/migration-pickers-v6.md
Outdated
Show resolved
Hide resolved
docs/data/migration/migration-pickers-v6/migration-pickers-v6.md
Outdated
Show resolved
Hide resolved
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.
Great improvement! 👍 👏
docs/data/migration/migration-pickers-v6/migration-pickers-v6.md
Outdated
Show resolved
Hide resolved
AdapterLuxon
Co-authored-by: Lukas <llukas.tyla@gmail.com> Signed-off-by: Flavien DELANGLE <flaviendelangle@gmail.com>
Co-authored-by: Michel Engelen <32863416+michelengelen@users.noreply.github.com> Signed-off-by: Flavien DELANGLE <flaviendelangle@gmail.com>
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
Co-authored-by: Lukas <llukas.tyla@gmail.com> Signed-off-by: Flavien DELANGLE <flaviendelangle@gmail.com>
Co-authored-by: Lukas <llukas.tyla@gmail.com> Signed-off-by: Flavien DELANGLE <flaviendelangle@gmail.com>
Co-authored-by: Lukas <llukas.tyla@gmail.com> Signed-off-by: Flavien DELANGLE <flaviendelangle@gmail.com>
Fixes #10805
Changelog
Highlight
🚀 The Date and Time Pickers now support localized week when using
AdapterLuxon
.When using Luxon 3.4.4 or higher, the start of the week will be defined by the date locale (e.g.: Sunday for
en-US
, Monday forfr-FR
).Breaking changes
The Date and Time Pickers now use the localized week when using
AdapterLuxon
and Luxon v3.4.4 or higher is installed.This new behavior allows
AdapterLuxon
to have the same behavior as the other adapters.If you want to keep the start of the week on Monday even if your locale says otherwise, you can hardcode the week settings as follows: