jalaali-1.0.0.0: Jalaali calendar systems
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.Time.Calendar.Jalaali

Description

Functions for working with Jalaali calendar systems. This library mimics the API of Data.Time.Calendar.Gregorian.

Synopsis

Documentation

isJalaaliLeapYear :: Integer -> Bool Source #

Is this year a leap year according to the Jalaali calendar?

toJalaali :: Day -> (Integer, Int, Int) Source #

Convert to Jalaali calendar. First element of result is year, second month number (1-12), third day (1-31).

fromJalaali :: Integer -> Int -> Int -> Day Source #

Convert from Jalaali calendar. First argument is year, second month number (1-12), third day (1-31). Invalid values will be clipped to the correct range, month first, then day.

fromJalaaliValid :: Integer -> Int -> Int -> Maybe Day Source #

Convert from Jalaali calendar. First argument is year, second month number (1-12), third day (1-31). Invalid values will return Nothing.

jalaaliMonthLength :: Integer -> Int -> Int Source #

The number of days in a given month according to the Jalaali calendar. First argument is year, second is month.

showJalaali :: Day -> String Source #

Show in slash-separated format (yyyymmdd).

addJalaaliMonthsClip :: Integer -> Day -> Day Source #

Add months, with days past the last day of the month clipped to the last day. For instance, 14000531 + 7 months = 14001229.

addJalaaliMonthsRollOver :: Integer -> Day -> Day Source #

Add months, with days past the last day of the month rolling over to the next month. For instance, 14000531 + 7 months = 14010102.

addJalaaliYearsClip :: Integer -> Day -> Day Source #

Add years, matching month and day, with Esfand 30th clipped to Esfand 29th if necessary. For instance, 13991230 + 1 year = 14001229.

addJalaaliYearsRollOver :: Integer -> Day -> Day Source #

Add years, matching month and day, with Esfand 30th rolled over to Farvardin 1st if necessary. For instance, 13991230 + 1 year = 14010101.

addJalaaliDurationClip :: CalendarDiffDays -> Day -> Day Source #

Add months (clipped to last day), then add days.

addJalaaliDurationRollOver :: CalendarDiffDays -> Day -> Day Source #

Add months (rolling over to next month), then add days.