fix: set current day like start term if less
All checks were successful
Build and Deploy Angular App / build (push) Successful in 57s

This commit is contained in:
Polianin Nikita 2024-08-27 21:47:21 +03:00
parent 80ab5c9b50
commit 660f251b40

View File

@ -87,6 +87,9 @@ export class ScheduleComponent {
private calculateCurrentWeek() {
let currentDate = new Date();
if (currentDate.getDate() < this.startTerm.getDate())
currentDate = this.startTerm;
function startOfWeek(date: Date) {
return addDays(date, -date.getDay() + 1);
}