-
-
Notifications
You must be signed in to change notification settings - Fork 1.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
[pickers] Week no longer respect date-fns
weekStartsOn
option
#12323
Comments
I think this is a question of prefrences here is someone who went through a lot of trouble to change the starting day to sunday before the update #7670 |
The components should follow the locale I'll have a look |
This regression was kind of introduced in v6.19.0 by #11462 The solution is probably to pass the public startOfWeek = (value: Date) => {
return startOfWeek(value, {
locale: this.locale,
weekStartsOn: (getDefaultOptions() as any).weekStartsOn,
});
}; But this seems to not be compatible with SSR because (in NextJS at least), date-fns cc @LukasTy |
date-fns
weekStartsOn
option
@evan-buss, changing the value inside the locale works: const customLocale = {
...enUS,
options: { ...enUS.options, weekStartsOn: 1 as const }
}
<LocalizationProvider dateAdapter={AdapterDateFns} adapterLocale={customLocale}>
{children}
</LocalizationProvider> I'm not sure we will be able to properly support |
As Flavien has mentioned, there does not seem to be a better approach than just going with what Looks like updating the recommendation is our best course of action. 👌 |
How did we do @evan-buss? |
Steps to reproduce
After upgrading my dependencies, the calendar popup no longer adjusts the week start based on
date-fns
configuration.Link to live example: (required)
v6.16.0
v6.19.6
Current behavior
No response
Expected behavior
No response
Context
Your environment
npx @mui/envinfo
Search keywords: week start, monday
Search keywords:
The text was updated successfully, but these errors were encountered: