summaryrefslogtreecommitdiff
path: root/CosmicCalendar.hs
diff options
context:
space:
mode:
Diffstat (limited to 'CosmicCalendar.hs')
-rw-r--r--CosmicCalendar.hs7
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'
93localTimeToYearElapsed :: LocalTime -> NominalDiffTime 93localTimeToYearElapsed :: LocalTime -> NominalDiffTime
94localTimeToYearElapsed t = t `diffLocalTime` yearStart t 94localTimeToYearElapsed t = t `diffLocalTime` yearStart t
95 95
96getLastCalendarEntry :: LocalTime -> Maybe CalendarEntry 96getPreviousCalendarEntry :: LocalTime -> Maybe CalendarEntry
97getLastCalendarEntry (localTimeToYearElapsed -> t) = snd <$> Map.lookupLE t theCalendar 97getPreviousCalendarEntry (localTimeToYearElapsed -> t) = snd <$> Map.lookupLT t theCalendar
98
99getCurrentCalendarEntry :: LocalTime -> Maybe CalendarEntry
100getCurrentCalendarEntry (localTimeToYearElapsed -> t) = snd <$> Map.lookupLE t theCalendar
98 101
99getNextCalendarEntry :: LocalTime -> Maybe CalendarEntry 102getNextCalendarEntry :: LocalTime -> Maybe CalendarEntry
100getNextCalendarEntry (localTimeToYearElapsed -> t) = snd <$> Map.lookupGT t theCalendar 103getNextCalendarEntry (localTimeToYearElapsed -> t) = snd <$> Map.lookupGT t theCalendar