mirror of
https://gitlab.dit.htwk-leipzig.de/htwk-software/htwkalender-pwa.git
synced 2025-08-09 05:07:46 +02:00
special case: merge two semesters at end of semester
This commit is contained in:
@@ -74,6 +74,10 @@ func GetRoomOccupancyList(app *pocketbase.PocketBase, granularity int) (model.Ro
|
||||
fromTime := functions.GetSemesterStart(now)
|
||||
toTime := functions.GetSemesterStart(now.AddDate(0, 6, 0))
|
||||
|
||||
if functions.IsLastMonthOfSemester(now) {
|
||||
toTime = functions.GetSemesterStart(now.AddDate(1, 0, 0))
|
||||
}
|
||||
|
||||
// calculate the number of blocks for the given time range and granularity
|
||||
timeDifference := toTime.Sub(fromTime)
|
||||
numberOfBlocks := int(math.Ceil(timeDifference.Minutes() / float64(granularity)))
|
||||
|
Reference in New Issue
Block a user