-
-
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
[docs] Add a doc section on how to override the start of the week with each adapter #11223
Conversation
@@ -80,31 +80,6 @@ import 'moment/locale/de'; | |||
|
|||
{{"demo": "LocalizationMoment.js"}} | |||
|
|||
:::warning |
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.
We are no longer using any moment
method that are not localized.
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 addition to the doc. 👍
I've just now checked that we might want to reconsider the release of this Luxon localized feature, because it's not going to work on Firefox. 🙈 🤯
https://moment.github.io/luxon/#/intl?id=locale-based-weeks
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/getWeekInfo#browser_compatibility
WDYT? On one hand, it's still an improvement for most, but on the other hand, it could be an annoying issue for others. 🤔
Maybe we should at least add a callout informing that currently Firefox does not support the localized Luxon behavior? 🤔
P.S. I was unable to locate an active firefox issue tracking the progress of this feature delivery. 🤷
|
||
## Custom start of week | ||
|
||
The Date and Time Pickers are using the week settings provided by your date libraries. |
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 Date and Time Pickers are using the week settings provided by your date libraries. | |
The Date and Time Pickers are using the week settings provided by the date library you are using. |
The Date and Time Pickers are using the week settings provided by your date libraries. | ||
Each adapter uses its locale to define the start of the week. | ||
|
||
If the default start of the week defined in your adapter's locale is not the one you want, you can override it as shown in the following examples. |
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.
If the default start of the week defined in your adapter's locale is not the one you want, you can override it as shown in the following examples. | |
If the default start of the week provided by your adapter's locale is not the one you want, you can override it as shown in the following examples. |
😭 |
Well, it simply doesn't react to the language/locale. Having English(en-us) set still renders the calendar the ISO way (starts on Monday). |
How do you think we should handle this feature then?
|
This option makes the most sense to me. |
I'm fine with this approach. Would you do something like we proposed originally in this API ? <LocalizationProvider adapter={AdapterLuxon.withLocaleWeeks()}>
</LocalizationProvider> Or do you have another API in mind? |
The proposed approach does seem the least intrusive, I like it. 👌 |
We decided to keep the Luxon behavior opt-out for 4 reasons;
We are adding a warning on the doc to show people how to manually set the start of the week. |
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.
LGTM! 💯 🚀
Co-authored-by: Lukas <[email protected]> Signed-off-by: Flavien DELANGLE <[email protected]>
Closes #9785
I initially added demos but since the locale configuration is global, it impacts all the other demos 😬