fix: negative or zero number
All checks were successful
Build and Deploy Angular App / build (push) Successful in 1m1s

This commit is contained in:
Polianin Nikita 2024-08-27 21:41:37 +03:00
parent dba0d3cd62
commit 80ab5c9b50

View File

@ -108,6 +108,11 @@ export class ScheduleComponent {
}
get currentWeek(): number {
return (weekInYear(this.startWeek) - weekInYear(this.startTerm)) + 1;
let result = (weekInYear(this.startWeek) - weekInYear(this.startTerm)) + 1;
if (result <= 0)
result = 1;
return result;
}
}