Archived
Private
Public Access
1
0

fixed date calculation on home page + added multi Q support in units

This commit is contained in:
2023-05-02 14:22:13 +02:00
parent f3d870bc6e
commit 0f6c5490e4
4 changed files with 65 additions and 5 deletions

View File

@@ -53,7 +53,7 @@ export class HomePage implements OnInit {
this.lessons = timetable[scheduleDay].filter(lesson => lesson != undefined);
}
if (this.dateIsPast(unitsData.date, new Date())) {
if (this.dateIsPast(unitsData.date, this.today)) {
unitsData = await this.units.getSubstitutionPlan("tomorrow");
}
this.subs = unitsData.substitutions?.filter(subs => subs.classes.includes(this.classData.class));
@@ -65,7 +65,7 @@ export class HomePage implements OnInit {
}
private dateIsPast(first: Date, second: Date): boolean {
return first.setHours(0, 0, 0, 0) <= second.setHours(0, 0, 0, 0);
return first.setHours(0, 0, 0, 0) < second.setHours(0, 0, 0, 0);
}
}