Skip to content

Commit

Permalink
fix: 🐛 Better fix for the isoWeek bug in Timetable
Browse files Browse the repository at this point in the history
  • Loading branch information
kajetan-kazimierczak committed Jan 14, 2023
1 parent 3acd27c commit ea6b385
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions apps/skolplattformen-app/components/week.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -107,13 +107,7 @@ export const Day = ({ weekDay, lunch, lessons }: DayProps) => {
}

export const Week = ({ child }: WeekProps) => {
const locale = LanguageService.getLocale()
moment.updateLocale(locale, {
week: {
dow: 1, // Monday is the first day of the week.
},
})
moment.locale(locale)
moment.locale(LanguageService.getLocale())
const days = moment.weekdaysShort().slice(1, 6)
const displayDate = getMeaningfulStartingDate(moment())

Expand Down Expand Up @@ -165,7 +159,10 @@ export const Week = ({ child }: WeekProps) => {
<>
<Text style={styles.tabTitle}>{weekDay}</Text>
<Text style={styles.tabTitleDate}>
{displayDate.startOf('week').add(index, 'day').format('D')}
{displayDate
.startOf('isoWeek')
.add(index, 'day')
.format('D')}
</Text>
</>
)}
Expand Down

0 comments on commit ea6b385

Please sign in to comment.