diff --git a/src/pages/schedule/schedule.component.ts b/src/pages/schedule/schedule.component.ts index 8d25875..a2d666c 100644 --- a/src/pages/schedule/schedule.component.ts +++ b/src/pages/schedule/schedule.component.ts @@ -141,7 +141,16 @@ export class ScheduleComponent { } get currentWeek(): number { - let result = (weekInYear(this.startWeek) - weekInYear(this.startTerm)) + 1; + const startTermWeek = weekInYear(this.startTerm); + let startWeekNumber; + const startWeek = addDays(this.startWeek, 6); + + if (startWeek.getFullYear() > this.startTerm.getFullYear()) + startWeekNumber = weekInYear(new Date(this.startTerm.getFullYear(), 11, 29)) + weekInYear(startWeek); + else + startWeekNumber = weekInYear(startWeek); + + let result = startWeekNumber - startTermWeek + 1; if (result <= 0) result = 1;