From 113f21fc29fb1c524f066daa2f7dbda6a572f022 Mon Sep 17 00:00:00 2001 From: Sarah Vaupel <> Date: Sun, 23 Aug 2020 17:46:33 +0200 Subject: [PATCH] fix(schedule-week): correctly display exam occurrences > 1d --- src/Utils/Schedule/Week.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Utils/Schedule/Week.hs b/src/Utils/Schedule/Week.hs index 79fda128e..1fe3dd8f5 100644 --- a/src/Utils/Schedule/Week.hs +++ b/src/Utils/Schedule/Week.hs @@ -181,8 +181,8 @@ formatOccurrenceW = \case Right (Right ScheduleWeekly{..}) -> [whamlet| _{MsgScheduleTime}: |] <> formatTimeRangeW SelFormatTime scheduleStart (Just scheduleEnd) Right (Left ExceptOccur{..}) -> [whamlet| _{MsgScheduleOccur}: |] <> formatTimeRangeW SelFormatTime (LocalTime exceptDay exceptStart) (Just $ LocalTime exceptDay exceptEnd) Right (Left ExceptNoOccur{}) -> [whamlet| _{MsgScheduleNoOccur} |] -- <> formatTimeW SelFormatDateTime exceptTime - Left ScheduleEntryExamOccurrence{..} -> [whamlet| _{MsgScheduleOccur}: |] <> formatTimeRangeW SelFormatTime seeoStart seeoEnd - + Left ScheduleEntryExamOccurrence{..} -> [whamlet| _{MsgScheduleOccur}: |] <> formatTimeRangeW selFormat seeoStart seeoEnd + where selFormat = bool SelFormatDateTime SelFormatTime $ maybe True ((utctDay seeoStart ==) . utctDay) seeoEnd -- | Uniquely identify each day as table head -- | This avoids constantly hiding e.g. some DayOfWeek (which would interfere with day offsets) dayTableHeadIdent :: Day -> Text