diff options
Diffstat (limited to 'CosmicCalendar.hs')
-rw-r--r-- | CosmicCalendar.hs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/CosmicCalendar.hs b/CosmicCalendar.hs index 8def5b7..290fa3a 100644 --- a/CosmicCalendar.hs +++ b/CosmicCalendar.hs | |||
@@ -93,8 +93,11 @@ yearStart (LocalTime d _) = LocalTime d' t' | |||
93 | localTimeToYearElapsed :: LocalTime -> NominalDiffTime | 93 | localTimeToYearElapsed :: LocalTime -> NominalDiffTime |
94 | localTimeToYearElapsed t = t `diffLocalTime` yearStart t | 94 | localTimeToYearElapsed t = t `diffLocalTime` yearStart t |
95 | 95 | ||
96 | getLastCalendarEntry :: LocalTime -> Maybe CalendarEntry | 96 | getPreviousCalendarEntry :: LocalTime -> Maybe CalendarEntry |
97 | getLastCalendarEntry (localTimeToYearElapsed -> t) = snd <$> Map.lookupLE t theCalendar | 97 | getPreviousCalendarEntry (localTimeToYearElapsed -> t) = snd <$> Map.lookupLT t theCalendar |
98 | |||
99 | getCurrentCalendarEntry :: LocalTime -> Maybe CalendarEntry | ||
100 | getCurrentCalendarEntry (localTimeToYearElapsed -> t) = snd <$> Map.lookupLE t theCalendar | ||
98 | 101 | ||
99 | getNextCalendarEntry :: LocalTime -> Maybe CalendarEntry | 102 | getNextCalendarEntry :: LocalTime -> Maybe CalendarEntry |
100 | getNextCalendarEntry (localTimeToYearElapsed -> t) = snd <$> Map.lookupGT t theCalendar | 103 | getNextCalendarEntry (localTimeToYearElapsed -> t) = snd <$> Map.lookupGT t theCalendar |