discordian-calendar-0.1: library for handling Discordian calendar dates

Safe HaskellNone




toDiscordian :: Day -> (Integer, Maybe (Int, Int))Source

Converts a modified Julian date to a Discordian date

The result format is either (year, Just (season, day)) for normal days or (year, Nothing) for St. Tibs Day

fromDiscordian :: Integer -> Int -> Int -> DaySource

Converts the Discordian date to the modified Julian date, clipping values to valid ranges.

Because St. Tibs Day is not considered part of the Discordian week, you should use the stTibsDay function to calculate those days.

fromDiscordianValid :: Integer -> Int -> Int -> Maybe DaySource

Similar to fromDiscordian, but invalid dates result in Nothing

stTibsDay :: Integer -> Maybe DaySource

Converts the St. Tibs Day of a given year to its equivalent modified Julian date. A value of Nothing indicates no St. Tibs Day for the given year.

showSeason :: Int -> StringSource

Show the name of a Discordian season. Input values are clipped to valid ranges.

showDayOfWeek :: Int -> Int -> StringSource

Given the season and day, show the name of the day of the week. Input values are clipped to valid ranges.

ddate :: Day -> StringSource

A function that emulates the default behavior of the ddate command-line utility