diff options
Diffstat (limited to 'CosmicCalendar.hs')
-rw-r--r-- | CosmicCalendar.hs | 3 |
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 | |||
123 | getNextCalendarEntry :: Calendar -> LocalTime -> Maybe CalendarEntry | 123 | getNextCalendarEntry :: Calendar -> LocalTime -> Maybe CalendarEntry |
124 | getNextCalendarEntry cal (localTimeToYearElapsed -> t) = snd <$> Map.lookupGT t cal | 124 | getNextCalendarEntry cal (localTimeToYearElapsed -> t) = snd <$> Map.lookupGT t cal |
125 | 125 | ||
126 | buildCalendar :: [CalendarEntry] -> Map NominalDiffTime CalendarEntry | ||
127 | buildCalendar ls = Map.fromList $ map (\x -> (calBeginTime x, x)) $ map unwrap ls | ||
128 | |||
126 | unwrap :: CalendarEntry -> CalendarEntry | 129 | unwrap :: CalendarEntry -> CalendarEntry |
127 | unwrap x@CalendarEntry{..} = x { calDescription = unwrapText calDescription } | 130 | unwrap x@CalendarEntry{..} = x { calDescription = unwrapText calDescription } |
128 | where | 131 | where |