summaryrefslogtreecommitdiff
path: root/CosmicCalendar.hs
diff options
context:
space:
mode:
Diffstat (limited to 'CosmicCalendar.hs')
-rw-r--r--CosmicCalendar.hs3
1 files changed, 3 insertions, 0 deletions
diff --git a/CosmicCalendar.hs b/CosmicCalendar.hs
index bab94da..db29c02 100644
--- a/CosmicCalendar.hs
+++ b/CosmicCalendar.hs
@@ -123,6 +123,9 @@ type Calendar = Map NominalDiffTime CalendarEntry
123getNextCalendarEntry :: Calendar -> LocalTime -> Maybe CalendarEntry 123getNextCalendarEntry :: Calendar -> LocalTime -> Maybe CalendarEntry
124getNextCalendarEntry cal (localTimeToYearElapsed -> t) = snd <$> Map.lookupGT t cal 124getNextCalendarEntry cal (localTimeToYearElapsed -> t) = snd <$> Map.lookupGT t cal
125 125
126buildCalendar :: [CalendarEntry] -> Map NominalDiffTime CalendarEntry
127buildCalendar ls = Map.fromList $ map (\x -> (calBeginTime x, x)) $ map unwrap ls
128
126unwrap :: CalendarEntry -> CalendarEntry 129unwrap :: CalendarEntry -> CalendarEntry
127unwrap x@CalendarEntry{..} = x { calDescription = unwrapText calDescription } 130unwrap x@CalendarEntry{..} = x { calDescription = unwrapText calDescription }
128 where 131 where