Berücksichtige zweiwöchentliche Rythmen bei der Raumkapazität
This commit is contained in:
parent
ae3f261047
commit
12a5080659
1 changed files with 3 additions and 1 deletions
|
@ -240,9 +240,11 @@ 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
|
||||
}
|
||||
}
|
||||
}
|
||||
if minuteCount > count {
|
||||
count = minuteCount
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue