refactor(schedule-week): use dayNowOffset

This commit is contained in:
Sarah Vaupel 2020-08-24 23:21:56 +02:00
parent 798a0811b7
commit 67302a5dd1

View File

@ -111,7 +111,7 @@ weekSchedule uid dayOffset = do
-- TODO: Internationalize default week start (and/or make configurable)
-- TODO: auto-hide saturday and sunday (if there are no events scheduled)?
week :: [Day]
week = go $ fromMaybe 0 dayOffset `addDays` utctDay now
week = go dayNowOffset
where go day
| dayOfWeek day == firstDay = [day .. toEnum (fromEnum day + 6)]
| otherwise = go $ pred day