diff --git a/src/Utils/Schedule/Week.hs b/src/Utils/Schedule/Week.hs index afa95b11d..06ef0533d 100644 --- a/src/Utils/Schedule/Week.hs +++ b/src/Utils/Schedule/Week.hs @@ -38,6 +38,7 @@ slotToDisplayTime t = formatTimeRangeW SelFormatTime (TimeOfDay t 0 0) $ Just $ weekSchedule :: UserId -> Maybe Int -> Widget weekSchedule uid _weekOffset = do now <- liftIO getCurrentTime + tz <- liftIO getCurrentTimeZone ata <- getSessionActiveAuthTags -- TODO: single runDB for all fetches below? @@ -138,14 +139,15 @@ weekSchedule uid _weekOffset = do -> day == localDay && TimeOfDay slot 0 0 <= localTimeOfDay && localTimeOfDay < TimeOfDay (slot+slotStep) 0 0 - Left ScheduleEntryExamOccurrence{..} -> let slotUTCTime = UTCTime - { utctDay = day - , utctDayTime = timeOfDayToTime (TimeOfDay slot 0 0) - } - nextSlotUTCTime = UTCTime - { utctDay = day - , utctDayTime = timeOfDayToTime (TimeOfDay (slot+slotStep) 0 0) - } + Left ScheduleEntryExamOccurrence{..} -> let + ( slotDayOffset, slotTimeOfDay) = localToUTCTimeOfDay tz $ TimeOfDay slot 0 0 + (nextSlotDayOffset, nextSlotTimeOfDay) = localToUTCTimeOfDay tz $ TimeOfDay (slot+slotStep) 0 0 + slotUTCTime = UTCTime { utctDay = slotDayOffset `addDays` day + , utctDayTime = timeOfDayToTime slotTimeOfDay + } + nextSlotUTCTime = UTCTime { utctDay = nextSlotDayOffset `addDays` day + , utctDayTime = timeOfDayToTime nextSlotTimeOfDay + } in slotUTCTime <= seeoStart && seeoStart < nextSlotUTCTime