From 73767400b37e4368b82bd5e318d064178cd16372 Mon Sep 17 00:00:00 2001 From: Kajetan Kazimierczak Date: Sat, 14 Jan 2023 17:23:48 +0100 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20=F0=9F=90=9B=20Week=20starts=20on=20?= =?UTF-8?q?monday=20regardless=20of=20selected=20locale?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/skolplattformen-app/components/week.component.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/apps/skolplattformen-app/components/week.component.tsx b/apps/skolplattformen-app/components/week.component.tsx index 01c3e174e..90c54652e 100644 --- a/apps/skolplattformen-app/components/week.component.tsx +++ b/apps/skolplattformen-app/components/week.component.tsx @@ -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()) From b21955cf252016086fd1013f6fcdec831c09f5e2 Mon Sep 17 00:00:00 2001 From: Kajetan Kazimierczak Date: Sat, 14 Jan 2023 17:34:35 +0100 Subject: [PATCH 2/2] =?UTF-8?q?style:=20=F0=9F=92=84=20lint?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/skolplattformen-app/components/week.component.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/skolplattformen-app/components/week.component.tsx b/apps/skolplattformen-app/components/week.component.tsx index 90c54652e..893223ec0 100644 --- a/apps/skolplattformen-app/components/week.component.tsx +++ b/apps/skolplattformen-app/components/week.component.tsx @@ -107,11 +107,11 @@ export const Day = ({ weekDay, lunch, lessons }: DayProps) => { } export const Week = ({ child }: WeekProps) => { - const locale = LanguageService.getLocale(); + const locale = LanguageService.getLocale() moment.updateLocale(locale, { week: { - dow : 1, // Monday is the first day of the week. - } + dow: 1, // Monday is the first day of the week. + }, }) moment.locale(locale) const days = moment.weekdaysShort().slice(1, 6)