From 6ac1dc57d0881667624559cd28f13abace428f89 Mon Sep 17 00:00:00 2001 From: Sarah Vaupel <> Date: Thu, 20 Aug 2020 17:50:47 +0200 Subject: [PATCH] feat(schedule): enhance display of days --- src/Utils/Schedule.hs | 5 +++-- templates/widgets/schedule/week.hamlet | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Utils/Schedule.hs b/src/Utils/Schedule.hs index 55297946a..d330ea098 100644 --- a/src/Utils/Schedule.hs +++ b/src/Utils/Schedule.hs @@ -137,6 +137,7 @@ weekSchedule uid _weekOffset = do -- TODO: Internationalize week start (and/or make configurable) -- TODO: auto-hide saturday and sunday (if there are no events scheduled)? + -- TODO: weekday messages deprecated / not used => remove weekDays :: [(Day, UniWorXMessage, Text)] weekDays = zipWith (\x (y,z) -> (x,y,z)) currentWeek [ (MsgScheduleWeekDayMonday , "mon") @@ -151,8 +152,8 @@ weekSchedule uid _weekOffset = do formatOccurrenceW :: ScheduleEntryOccurrence -> Widget formatOccurrenceW = \case Right ScheduleWeekly{..} -> [whamlet| _{MsgScheduleTime}: |] <> formatTimeRangeW SelFormatTime scheduleStart (Just scheduleEnd) - Left ExceptOccur{..} -> [whamlet| _{MsgScheduleOccur}: |] <> formatTimeRangeW SelFormatDateTime (LocalTime exceptDay exceptStart) (Just (LocalTime exceptDay exceptEnd)) - Left ExceptNoOccur{exceptTime} -> [whamlet| _{MsgScheduleNoOccur}: |] <> formatTimeW SelFormatDateTime exceptTime + Left ExceptOccur{..} -> [whamlet| _{MsgScheduleOccur}: |] <> formatTimeRangeW SelFormatTime (LocalTime exceptDay exceptStart) (Just (LocalTime exceptDay exceptEnd)) + Left ExceptNoOccur{} -> [whamlet| _{MsgScheduleNoOccur} |] -- <> formatTimeW SelFormatDateTime exceptTime $(widgetFile "widgets/schedule/week") diff --git a/templates/widgets/schedule/week.hamlet b/templates/widgets/schedule/week.hamlet index 1a76b93c8..f6af967bb 100644 --- a/templates/widgets/schedule/week.hamlet +++ b/templates/widgets/schedule/week.hamlet @@ -5,9 +5,9 @@ $newline never