-
-
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
[adapters] Fix localisation of the placeholder #6547
Conversation
These are the results for the performance tests:
|
return this.moment | ||
.localeData(this.getCurrentLocaleCode()) | ||
.longDateFormat(token as LongDateFormatKey); |
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.
This is needed because otherwise the default locale of moment will be applied (the last imported one)
It's a part of code copypasted from date-io. after this PR I will add the modification to date-io
@@ -70,18 +72,25 @@ export function wrapPickerMount(mount: (node: React.ReactNode) => import('enzyme | |||
|
|||
export function createPickerRenderer({ | |||
locale, | |||
adapterName, |
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 can run the entire test codebase with any of the adapters. But only some of them are relevant to be run on various adapters. That's why I add this parameter. By priority, tests run with the adapter provided by:
- adapterName
- test:unit paramter
- date-fns (default one)
commit 634aabe Author: Matheus Wichman <[email protected]> Date: Wed Oct 19 20:26:54 2022 -0300 Update migration guide commit 40bbeef Merge: d49de67 4fbb67d Author: Matheus Wichman <[email protected]> Date: Wed Oct 19 11:07:48 2022 -0300 Merge branch 'next' into rename-selection-props commit 4fbb67d Author: Danail Hadjiatanasov <[email protected]> Date: Wed Oct 19 15:26:21 2022 +0300 [test] Remove BrowserStack (mui#6263) commit fff240b Author: Olivier Tassinari <[email protected]> Date: Wed Oct 19 14:18:46 2022 +0200 [core] Fix trailing spaces and git diff format (mui#6523) Signed-off-by: Olivier Tassinari <[email protected]> commit 4488896 Author: Olivier Tassinari <[email protected]> Date: Wed Oct 19 13:37:09 2022 +0200 [core] Improve the playground DX (mui#6514) commit e195e5a Author: Olivier Tassinari <[email protected]> Date: Wed Oct 19 13:30:12 2022 +0200 [core] Link Netlify in the danger comment (mui#6513) commit a4fedc1 Author: Alexandre Fauquette <[email protected]> Date: Wed Oct 19 11:57:42 2022 +0200 [adapters] Fix localisation of the placeholder (mui#6547) commit d49de67 Author: Matheus Wichman <[email protected]> Date: Tue Oct 18 19:17:48 2022 -0300 [DataGrid] Rename selection props
Fix #6540
Luxon has specific behavior about localization. You should always specify the locale when calling a method from
DateTime
Now the
adapterLocale
is applied to both the placeholder and the formatted for the 4 libraries