Material-ui-pickers: Set first day in calendar to Monday

Created on 22 Jan 2018  路  15Comments  路  Source: mui-org/material-ui-pickers

Hello.
Sorry if this is a wrong place to ask this question, but I cannot find how can set the first day of the week to Monday.

Is this possible?

bug 馃悰 DatePicker

Most helpful comment

@Joseph-Cass - using moment I changed the locale by updating week: { dow: 1 }. This seems to push back the start of the week by that many days, from the locale's inherent start day.

Code here: https://codesandbox.io/s/material-datepicker-set-start-day-8x4vy?file=/src/App.js.

All 15 comments

@ysokolovsky Hi, first day of week depends on your locale. You can set it like this: https://github.com/dmtrKovalenko/material-ui-pickers#l10n

@cherniavskii unfortunately, now it's also broken
loc_bug
as you can see, weekday names stay in English even after changing the locale, also today is Tue 23, but the calendar displays it as Monday

Yep, seems like moment doesnt change it - we should do it manually as we wish to replace moment at all.

It works for me.
I set French locale in moment, see: https://codesandbox.io/s/r051xlj4mm

Looks like reported bug is reproducible only when toggling locale without page reload

Close due to no updates.

@dmtrKovalenko hello, here's a reproducer (russian locale):
https://codesandbox.io/s/xr0mn0yo8z

Fixed by #371

Hello.
Sorry if this is a wrong place to ask this question, but I cannot find how can set the first day of the week to Monday.

Is this possible?

I feel like this question still hasn't been answered... I cannot achieve this effect on my KeyboardTimePicker.

@Joseph-Cass Set the right locale.

@Joseph-Cass Set the right locale.

And what is the "right locale" to start the week on a Monday?

@Joseph-Cass What's your use case? Why do you need the week to start Monday?

Many calendars start the week on a Monday (default for iOS and Outlook from my experience), at least in the UK.

I believe Monday is the most logic start of the week, but even if you disagree, I believe this should be a simple setting to change? (I have also still had 0 success with the suggestions above, and changing the locale doesn't seem to change anything for my KeyboardTimePicker)

The react-big-calendar makes it easy by importing momentLocalizer from 'react-big-calendar', adding const localizer = momentLocalizer(moment) and setting localizer={localizer}.

Make sure that all libraries are using en-US as default locale. It is some kind of standard. If your app is using en-UK locale you need to explicitly specify it.

We are only referring selected locale. The same for clock cycle 12h/24h.

Many calendars start the week on a Monday (default for iOS and Outlook from my experience), at least in the UK.

Right, in the UK. It's all about the convention of your locale.

@dmtrKovalenko I have seen this confusion come quite often. We could consider a mini-FAQ for the date pickers.

@Joseph-Cass - using moment I changed the locale by updating week: { dow: 1 }. This seems to push back the start of the week by that many days, from the locale's inherent start day.

Code here: https://codesandbox.io/s/material-datepicker-set-start-day-8x4vy?file=/src/App.js.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

callmeberzerker picture callmeberzerker  路  3Comments

katy6514 picture katy6514  路  3Comments

dandv picture dandv  路  3Comments

aditya81070 picture aditya81070  路  3Comments

benneq picture benneq  路  3Comments