fix: set current day like start term if less
All checks were successful
Build and Deploy Angular App / build (push) Successful in 57s
All checks were successful
Build and Deploy Angular App / build (push) Successful in 57s
This commit is contained in:
parent
80ab5c9b50
commit
660f251b40
@ -87,6 +87,9 @@ export class ScheduleComponent {
|
|||||||
private calculateCurrentWeek() {
|
private calculateCurrentWeek() {
|
||||||
let currentDate = new Date();
|
let currentDate = new Date();
|
||||||
|
|
||||||
|
if (currentDate.getDate() < this.startTerm.getDate())
|
||||||
|
currentDate = this.startTerm;
|
||||||
|
|
||||||
function startOfWeek(date: Date) {
|
function startOfWeek(date: Date) {
|
||||||
return addDays(date, -date.getDay() + 1);
|
return addDays(date, -date.getDay() + 1);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user