dayjs localization
Is your feature request related to a problem? Please describe.
material-ui-pickers documentation mentions date-fns & moment, but nothing about dayjs.
Is it supported, and how to use it?
Configuring dayjs locale globaly before initialization partially works, but formats and weekStart (Sunday or Monday are still default one: english).
dayjs.extend(utc, {});
dayjs.locale('fr'); // default locale
<MuiPickersUtilsProvider utils={DayjsUtils} locale="fr">

Describe the solution you'd like
Official support & documentation for dayjs localization would be a must!
Additional context
Not sure if it is related but last date-io version mention support for dayjs localization:
https://github.com/dmtrKovalenko/date-io/pull/39
Any updates on this?
I'd like an update on this as well. Setting the local shifts the numbers for the days correctly, but the labels keep starting with Sunday instead of Monday.
I am not really sure it is possible with dayjs (weekdays shift)
There are any ideas? We have roll out material ui pickers with dayjs in production and realised that weekdays shift do not work properly 😅
It is possible with custom override. You will need to override
Snippet?
@dmtrKovalenko I investigated this a little and I think this is a bug in date-io wrapper around dayjs
DatePickerusesgetWeekdays()fromdate-iogetWeekdaysfor dayjs something like this:
const getWeekdays = () => [0, 1, 2, ...].map(n => dayjs.set('day', n).format('dd))
You can see it here: https://github.com/dmtrKovalenko/date-io/blob/master/packages/dayjs/src/dayjs-utils.ts#L209
While dayjs docs states that this way you will always get ['su', 'mo', 'tu', ...]:
docs

The solution I see is to use dayjs.startOf('week') in the date-io in the getWeekdays function.
In dayjs startOf('week') respects locale
related issue here https://github.com/dmtrKovalenko/date-io/issues/111
It is possible with custom override. You will need to override
@dmtrKovalenko thanks for your answer. So does it mean a "won't fix"?
@Toub it works in this patched fork: https://github.com/vmajsuk/date-io
"date-io": "https://github.com/vmajsuk/date-io"
import DayJsUtils from 'date-io/packages/dayjs/build
Waiting for an answer from @dmtrKovalenko about provided patch
@testarossaaaaa can you please make a PR to the original date-io?
@dmtrKovalenko https://github.com/dmtrKovalenko/date-io/pull/113
Could someone provide an example on how to achieve dayjs localization currently ?
In case someone is finding this issue because of the missing documentation:
just import the local from dayjs and set the local globally on dayjs:
import "dayjs/locale/de"
dayjs.locale("de")