Skip to content

Commit

Permalink
fix: 🐛 Week starts on monday regardless of selected locale (kolplattf…
Browse files Browse the repository at this point in the history
…ormen#642)

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

* style: 💄 lint
  • Loading branch information
kajetan-kazimierczak authored Jan 14, 2023
1 parent 7d8662f commit 7e8ee95
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion apps/skolplattformen-app/components/week.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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())

Expand Down

0 comments on commit 7e8ee95

Please sign in to comment.