Ändere Wochenfeld zu mehr Auswahl.

Closes #28
This commit is contained in:
Gonne 2025-04-02 14:50:42 +02:00
parent 5e954ca751
commit e05d30b886
Signed by: Gonne
SSH key fingerprint: SHA256:J8w3ZCNyz9MoTLV+eU7YRTVw59NYig44i0IWhbsgQG8
7 changed files with 13 additions and 11 deletions

View file

@ -245,9 +245,7 @@ func (r *OfficeHourRepo) NumberByTimeSpanAndRoom(date models.Date, duration int,
for _, officeHour := range officeHours {
// increase count if officehour starts before this point in time and ends later
if models.DateLess(officeHour.Date, models.GetEndDate(date, minute, false)) && models.DateLess(models.GetEndDate(date, minute, false), models.GetEndDate(officeHour.Date, officeHour.Duration, false)) {
if date.Week == 0 || officeHour.Week == 0 || date.Week == officeHour.Week { // office hours in alternating weeks should not collide
minuteCount += 1
}
minuteCount += 1
}
}
if minuteCount > count {