react-modern-calendar-datepicker
react-modern-calendar-datepicker copied to clipboard
First day of week
Is there a way to change first day of the week to Monday instead of default Sunday?
As far as I know you can only do that by creating a different locale. So please take a look at the docs and feel free to ask something that you can possible be stuck with.
// week days by order
weekDays: [
{
name: 'Monday', // used for accessibility
short: 'M', // displayed at the top of days' rows
},
{
name: 'Tuesday',
short: 'T',
},
// ...
As far as I know you can only do that by creating a different locale. So please take a look at the docs and feel free to ask something that you can possible be stuck with.
// week days by order weekDays: [ { name: 'Monday', // used for accessibility short: 'M', // displayed at the top of days' rows }, { name: 'Tuesday', short: 'T', }, // ...
This will show incorrect date for the month? I solved that by setting weekStartingIndex: 6
You have to use both of the above solutions simultaneously
// week days by order
weekDays: [
{
name: 'Monday', // used for accessibility
short: 'M', // displayed at the top of days' rows
},
{
name: 'Tuesday',
short: 'T',
},
{
name: 'Wednesday',
short: 'W',
},
{
name: 'Thursday',
short: 'T',
},
{
name: 'Friday',
short: 'F',
},
{
name: 'Saturday',
short: 'S',
isWeekend: true,
},
{
name: 'Sunday', // used for accessibility
short: 'S', // displayed at the top of days' rows
isWeekend: true, // is it a formal weekend or not?
},
],
weekStartingIndex: 6,
...