fix: 🐛 Week starts on monday regardless of selected locale (#642)

* fix: 🐛 Week starts on monday regardless of selected locale

* style: 💄 lint
This commit is contained in:
Kajetan Kazimierczak 2023-01-14 17:39:50 +01:00 committed by GitHub
parent 7d8662ff09
commit 7e8ee956f4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 1 deletions

View File

@ -107,7 +107,13 @@ export const Day = ({ weekDay, lunch, lessons }: DayProps) => {
}
export const Week = ({ child }: WeekProps) => {
moment.locale(LanguageService.getLocale())
const locale = LanguageService.getLocale()
moment.updateLocale(locale, {
week: {
dow: 1, // Monday is the first day of the week.
},
})
moment.locale(locale)
const days = moment.weekdaysShort().slice(1, 6)
const displayDate = getMeaningfulStartingDate(moment())