hodatime
Copyright(C) 2017 Jason Johnson
LicenseBSD-style (see the file LICENSE)
MaintainerJason Johnson <jason.johnson.081@gmail.com>
Stabilityexperimental
PortabilityPOSIX, Windows
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.HodaTime.Calendar.Islamic

Description

This is the module for CalendarDate and CalendarDateTime in the Islamic (Hijri) calendar, a purely lunar calendar of twelve months. The odd-numbered months (Muharram, RabiAlAwwal, … ) have 30 days and the even-numbered months (Safar, RabiAlThani, … ) have 29, except that the final month (DhulHijjah) gains a thirtieth day in a leap year. A common year is therefore 354 days and a leap year 355 — roughly eleven days shorter than a solar year, so Islamic dates drift steadily backwards through the seasons. Year 1 begins on 18.Jul.622 CE (proleptic Gregorian), the year of the Hijra; dates share the same absolute timeline as every other calendar.

Which Islamic calendar this is, and the choices we made

There is no single "Islamic calendar": the religiously authoritative one is observational (each month begins on the naked-eye sighting of the new crescent), which is inherently non-algorithmic and varies by location, so it cannot be computed. What software can compute is either the tabular (arithmetic) calendar or a tabulated astronomical calendar such as Umm al-Qura. This module implements the tabular arithmetic calendar. A tabular calendar leaves two parameters open — the leap-year pattern and the epoch — and we treat them differently:

  • Leap-year pattern: selectable, defaulting to "Base16" (type II). A leap pattern says which 11 of every 30 years carry the extra day. Four patterns are in common use, and the calendar is parameterised over them at the type level (see below), so a date always records which pattern built it and the type system refuses to mix incompatible ones. The default, Base16 — leap years 2, 5, 7, 10, 13, 16, 18, 21, 24, 26 and 29 of each cycle — is the pattern used by the .NET BCL HijriCalendar and NodaTime's IslamicBcl, so it is the most interoperable choice and the one we cross-check against.
  • Epoch: fixed to astronomical ("Thursday") — 18.Jul.622 CE (proleptic Gregorian), Julian day 1948439. The alternative "civil" ("Friday") epoch is exactly one day later. Unlike the leap pattern, the epoch does not change the calendar's internal structure (month lengths, leap years, arithmetic); it only shifts how Islamic dates line up with the absolute timeline — i.e. their Instant, their Gregorian correspondence and their day-of-week — by that one day. Because it is a one-day alignment convention rather than a structurally different calendar, we fix it (to the astronomical epoch, matching the .NET BCL and NodaTime) rather than expose it. Were it ever wanted it would become a second type parameter in exactly the same way as the leap pattern, a non-breaking change (today's Islamic l would become a synonym for Islamic l Astronomical).

Being purely arithmetic, the calendar is exact by definition (there is no astronomical approximation, unlike the astronomical Persian calendar) and total for every year, so — like the Coptic calendar — it is only floored at year 1 (the Hijra) and has no upper bound. Note that the tabular calendar can differ from an actual crescent sighting, and from the Umm al-Qura calendar, by a day or two; if you need to match observation you must use sighting data, which is outside the scope of an arithmetic calendar.

Selecting a leap pattern

The calendar type carries the leap pattern as a type parameter of kind LeapPattern: Islamic l. This is why ordinary, non-configurable calendars such as Gregorian are unaffected — only a calendar that actually has a choice to record gains a parameter, and it is always fully applied (e.g. CalendarDateTime (Islamic Base15)). Because the parameter is phantom, the month and weekday constructors (Muharram, Sunday, … ) are shared across every variant, but two dates built with different patterns have different types and cannot be combined or compared.

For convenience each pattern has a type synonym — IslamicBcl (the Base16 default), IslamicBase15, IslamicIndian and IslamicHabashAlHasib — and the constructors come in two forms:

Synopsis

Constructors (default IslamicBcl calendar)

calendarDate :: DayOfMonth -> Month IslamicBcl -> Year -> Maybe (CalendarDate IslamicBcl) Source #

Smart constructor for the default IslamicBcl calendar date. Returns Nothing if the day is out of range for the month or the year is before the epoch (year 1). Use calendarDate' to pick a different leap pattern.

fromNthDay :: DayNth -> DayOfWeek IslamicBcl -> Month IslamicBcl -> Year -> Maybe (CalendarDate IslamicBcl) Source #

Smart constructor for the default IslamicBcl calendar date given as a day relative to a month (e.g. the third Monday of the month). Returns Nothing if the resulting date is invalid.

fromWeekDate :: WeekNumber -> DayOfWeek IslamicBcl -> Year -> Maybe (CalendarDate IslamicBcl) Source #

Smart constructor for the default IslamicBcl calendar date given as a week date. Note that this method assumes weeks start on Saturday (as in the Islamic calendar) and the first week of the year is the one which has at least one day in the new year.

Constructors (choose the leap pattern)

calendarDate' :: forall l. KnownLeap l => DayOfMonth -> Month (Islamic l) -> Year -> Maybe (CalendarDate (Islamic l)) Source #

Smart constructor for an Islamic calendar date in any leap pattern (chosen by the result type). Returns Nothing if the day is out of range for the month or the year is before the epoch (year 1).

fromNthDay' :: forall l. KnownLeap l => DayNth -> DayOfWeek (Islamic l) -> Month (Islamic l) -> Year -> Maybe (CalendarDate (Islamic l)) Source #

As fromNthDay, but in any leap pattern (chosen by the result type).

fromWeekDate' :: forall l. KnownLeap l => WeekNumber -> DayOfWeek (Islamic l) -> Year -> Maybe (CalendarDate (Islamic l)) Source #

As fromWeekDate, but in any leap pattern (chosen by the result type).

Types

data family Month cal Source #

Instances

Instances details
Bounded (Month Coptic) Source # 
Instance details

Defined in Data.HodaTime.Calendar.Coptic

Bounded (Month Gregorian) Source # 
Instance details

Defined in Data.HodaTime.Calendar.Gregorian.Internal

Bounded (Month (Hebrew n)) Source # 
Instance details

Defined in Data.HodaTime.Calendar.Hebrew

Methods

minBound :: Month (Hebrew n) #

maxBound :: Month (Hebrew n) #

Bounded (Month (Islamic l)) Source # 
Instance details

Defined in Data.HodaTime.Calendar.Islamic

Bounded (Month Julian) Source # 
Instance details

Defined in Data.HodaTime.Calendar.Julian

Bounded (Month Persian) Source # 
Instance details

Defined in Data.HodaTime.Calendar.Persian

Enum (Month Coptic) Source # 
Instance details

Defined in Data.HodaTime.Calendar.Coptic

Enum (Month Gregorian) Source # 
Instance details

Defined in Data.HodaTime.Calendar.Gregorian.Internal

KnownNumbering n => Enum (Month (Hebrew n)) Source #

The Month Enum is the one place the numbering shows: it is calendar order rotated so counting begins at the numbering's start month (numberingStart).

Instance details

Defined in Data.HodaTime.Calendar.Hebrew

Methods

succ :: Month (Hebrew n) -> Month (Hebrew n) #

pred :: Month (Hebrew n) -> Month (Hebrew n) #

toEnum :: Int -> Month (Hebrew n) #

fromEnum :: Month (Hebrew n) -> Int #

enumFrom :: Month (Hebrew n) -> [Month (Hebrew n)] #

enumFromThen :: Month (Hebrew n) -> Month (Hebrew n) -> [Month (Hebrew n)] #

enumFromTo :: Month (Hebrew n) -> Month (Hebrew n) -> [Month (Hebrew n)] #

enumFromThenTo :: Month (Hebrew n) -> Month (Hebrew n) -> Month (Hebrew n) -> [Month (Hebrew n)] #

Enum (Month (Islamic l)) Source # 
Instance details

Defined in Data.HodaTime.Calendar.Islamic

Enum (Month Julian) Source # 
Instance details

Defined in Data.HodaTime.Calendar.Julian

Enum (Month Persian) Source # 
Instance details

Defined in Data.HodaTime.Calendar.Persian

Read (Month Coptic) Source # 
Instance details

Defined in Data.HodaTime.Calendar.Coptic

Read (Month Gregorian) Source # 
Instance details

Defined in Data.HodaTime.Calendar.Gregorian.Internal

Read (Month (Hebrew n)) Source # 
Instance details

Defined in Data.HodaTime.Calendar.Hebrew

Read (Month (Islamic l)) Source # 
Instance details

Defined in Data.HodaTime.Calendar.Islamic

Read (Month Julian) Source # 
Instance details

Defined in Data.HodaTime.Calendar.Julian

Read (Month Persian) Source # 
Instance details

Defined in Data.HodaTime.Calendar.Persian

Show (Month Coptic) Source # 
Instance details

Defined in Data.HodaTime.Calendar.Coptic

Show (Month Gregorian) Source # 
Instance details

Defined in Data.HodaTime.Calendar.Gregorian.Internal

Show (Month (Hebrew n)) Source # 
Instance details

Defined in Data.HodaTime.Calendar.Hebrew

Methods

showsPrec :: Int -> Month (Hebrew n) -> ShowS #

show :: Month (Hebrew n) -> String #

showList :: [Month (Hebrew n)] -> ShowS #

Show (Month (Islamic l)) Source # 
Instance details

Defined in Data.HodaTime.Calendar.Islamic

Methods

showsPrec :: Int -> Month (Islamic l) -> ShowS #

show :: Month (Islamic l) -> String #

showList :: [Month (Islamic l)] -> ShowS #

Show (Month Julian) Source # 
Instance details

Defined in Data.HodaTime.Calendar.Julian

Show (Month Persian) Source # 
Instance details

Defined in Data.HodaTime.Calendar.Persian

NFData (Month Coptic) Source # 
Instance details

Defined in Data.HodaTime.Calendar.Coptic

Methods

rnf :: Month Coptic -> () #

NFData (Month Gregorian) Source # 
Instance details

Defined in Data.HodaTime.Calendar.Gregorian.Internal

Methods

rnf :: Month Gregorian -> () #

NFData (Month (Hebrew n)) Source # 
Instance details

Defined in Data.HodaTime.Calendar.Hebrew

Methods

rnf :: Month (Hebrew n) -> () #

NFData (Month (Islamic l)) Source # 
Instance details

Defined in Data.HodaTime.Calendar.Islamic

Methods

rnf :: Month (Islamic l) -> () #

NFData (Month Julian) Source # 
Instance details

Defined in Data.HodaTime.Calendar.Julian

Methods

rnf :: Month Julian -> () #

NFData (Month Persian) Source # 
Instance details

Defined in Data.HodaTime.Calendar.Persian

Methods

rnf :: Month Persian -> () #

Eq (Month Coptic) Source # 
Instance details

Defined in Data.HodaTime.Calendar.Coptic

Eq (Month Gregorian) Source # 
Instance details

Defined in Data.HodaTime.Calendar.Gregorian.Internal

Eq (Month (Hebrew n)) Source # 
Instance details

Defined in Data.HodaTime.Calendar.Hebrew

Methods

(==) :: Month (Hebrew n) -> Month (Hebrew n) -> Bool #

(/=) :: Month (Hebrew n) -> Month (Hebrew n) -> Bool #

Eq (Month (Islamic l)) Source # 
Instance details

Defined in Data.HodaTime.Calendar.Islamic

Methods

(==) :: Month (Islamic l) -> Month (Islamic l) -> Bool #

(/=) :: Month (Islamic l) -> Month (Islamic l) -> Bool #

Eq (Month Julian) Source # 
Instance details

Defined in Data.HodaTime.Calendar.Julian

Eq (Month Persian) Source # 
Instance details

Defined in Data.HodaTime.Calendar.Persian

Ord (Month Coptic) Source # 
Instance details

Defined in Data.HodaTime.Calendar.Coptic

Ord (Month Gregorian) Source # 
Instance details

Defined in Data.HodaTime.Calendar.Gregorian.Internal

Ord (Month (Hebrew n)) Source # 
Instance details

Defined in Data.HodaTime.Calendar.Hebrew

Methods

compare :: Month (Hebrew n) -> Month (Hebrew n) -> Ordering #

(<) :: Month (Hebrew n) -> Month (Hebrew n) -> Bool #

(<=) :: Month (Hebrew n) -> Month (Hebrew n) -> Bool #

(>) :: Month (Hebrew n) -> Month (Hebrew n) -> Bool #

(>=) :: Month (Hebrew n) -> Month (Hebrew n) -> Bool #

max :: Month (Hebrew n) -> Month (Hebrew n) -> Month (Hebrew n) #

min :: Month (Hebrew n) -> Month (Hebrew n) -> Month (Hebrew n) #

Ord (Month (Islamic l)) Source # 
Instance details

Defined in Data.HodaTime.Calendar.Islamic

Methods

compare :: Month (Islamic l) -> Month (Islamic l) -> Ordering #

(<) :: Month (Islamic l) -> Month (Islamic l) -> Bool #

(<=) :: Month (Islamic l) -> Month (Islamic l) -> Bool #

(>) :: Month (Islamic l) -> Month (Islamic l) -> Bool #

(>=) :: Month (Islamic l) -> Month (Islamic l) -> Bool #

max :: Month (Islamic l) -> Month (Islamic l) -> Month (Islamic l) #

min :: Month (Islamic l) -> Month (Islamic l) -> Month (Islamic l) #

Ord (Month Julian) Source # 
Instance details

Defined in Data.HodaTime.Calendar.Julian

Ord (Month Persian) Source # 
Instance details

Defined in Data.HodaTime.Calendar.Persian

Hashable (Month Coptic) Source # 
Instance details

Defined in Data.HodaTime.Calendar.Coptic

Hashable (Month Gregorian) Source # 
Instance details

Defined in Data.HodaTime.Calendar.Gregorian.Internal

KnownNumbering n => Hashable (Month (Hebrew n)) Source # 
Instance details

Defined in Data.HodaTime.Calendar.Hebrew

Methods

hashWithSalt :: Int -> Month (Hebrew n) -> Int #

hash :: Month (Hebrew n) -> Int #

Hashable (Month (Islamic l)) Source # 
Instance details

Defined in Data.HodaTime.Calendar.Islamic

Methods

hashWithSalt :: Int -> Month (Islamic l) -> Int #

hash :: Month (Islamic l) -> Int #

Hashable (Month Julian) Source # 
Instance details

Defined in Data.HodaTime.Calendar.Julian

Hashable (Month Persian) Source # 
Instance details

Defined in Data.HodaTime.Calendar.Persian

data Month Coptic Source # 
Instance details

Defined in Data.HodaTime.Calendar.Coptic

data Month Gregorian Source # 
Instance details

Defined in Data.HodaTime.Calendar.Gregorian.Internal

data Month Julian Source # 
Instance details

Defined in Data.HodaTime.Calendar.Julian

data Month Persian Source # 
Instance details

Defined in Data.HodaTime.Calendar.Persian

data Month (Hebrew n) Source # 
Instance details

Defined in Data.HodaTime.Calendar.Hebrew

data Month (Islamic l) Source # 
Instance details

Defined in Data.HodaTime.Calendar.Islamic

data family DayOfWeek cal Source #

Instances

Instances details
Bounded (DayOfWeek Coptic) Source # 
Instance details

Defined in Data.HodaTime.Calendar.Coptic

Bounded (DayOfWeek Gregorian) Source # 
Instance details

Defined in Data.HodaTime.Calendar.Gregorian.Internal

Bounded (DayOfWeek (Hebrew n)) Source # 
Instance details

Defined in Data.HodaTime.Calendar.Hebrew

Bounded (DayOfWeek (Islamic l)) Source # 
Instance details

Defined in Data.HodaTime.Calendar.Islamic

Bounded (DayOfWeek Julian) Source # 
Instance details

Defined in Data.HodaTime.Calendar.Julian

Bounded (DayOfWeek Persian) Source # 
Instance details

Defined in Data.HodaTime.Calendar.Persian

Enum (DayOfWeek Coptic) Source # 
Instance details

Defined in Data.HodaTime.Calendar.Coptic

Enum (DayOfWeek Gregorian) Source # 
Instance details

Defined in Data.HodaTime.Calendar.Gregorian.Internal

Enum (DayOfWeek (Hebrew n)) Source # 
Instance details

Defined in Data.HodaTime.Calendar.Hebrew

Enum (DayOfWeek (Islamic l)) Source # 
Instance details

Defined in Data.HodaTime.Calendar.Islamic

Enum (DayOfWeek Julian) Source # 
Instance details

Defined in Data.HodaTime.Calendar.Julian

Enum (DayOfWeek Persian) Source # 
Instance details

Defined in Data.HodaTime.Calendar.Persian

Read (DayOfWeek Coptic) Source # 
Instance details

Defined in Data.HodaTime.Calendar.Coptic

Read (DayOfWeek Gregorian) Source # 
Instance details

Defined in Data.HodaTime.Calendar.Gregorian.Internal

Read (DayOfWeek (Hebrew n)) Source # 
Instance details

Defined in Data.HodaTime.Calendar.Hebrew

Read (DayOfWeek (Islamic l)) Source # 
Instance details

Defined in Data.HodaTime.Calendar.Islamic

Read (DayOfWeek Julian) Source # 
Instance details

Defined in Data.HodaTime.Calendar.Julian

Read (DayOfWeek Persian) Source # 
Instance details

Defined in Data.HodaTime.Calendar.Persian

Show (DayOfWeek Coptic) Source # 
Instance details

Defined in Data.HodaTime.Calendar.Coptic

Show (DayOfWeek Gregorian) Source # 
Instance details

Defined in Data.HodaTime.Calendar.Gregorian.Internal

Show (DayOfWeek (Hebrew n)) Source # 
Instance details

Defined in Data.HodaTime.Calendar.Hebrew

Show (DayOfWeek (Islamic l)) Source # 
Instance details

Defined in Data.HodaTime.Calendar.Islamic

Show (DayOfWeek Julian) Source # 
Instance details

Defined in Data.HodaTime.Calendar.Julian

Show (DayOfWeek Persian) Source # 
Instance details

Defined in Data.HodaTime.Calendar.Persian

NFData (DayOfWeek Coptic) Source # 
Instance details

Defined in Data.HodaTime.Calendar.Coptic

Methods

rnf :: DayOfWeek Coptic -> () #

NFData (DayOfWeek Gregorian) Source # 
Instance details

Defined in Data.HodaTime.Calendar.Gregorian.Internal

Methods

rnf :: DayOfWeek Gregorian -> () #

NFData (DayOfWeek (Hebrew n)) Source # 
Instance details

Defined in Data.HodaTime.Calendar.Hebrew

Methods

rnf :: DayOfWeek (Hebrew n) -> () #

NFData (DayOfWeek (Islamic l)) Source # 
Instance details

Defined in Data.HodaTime.Calendar.Islamic

Methods

rnf :: DayOfWeek (Islamic l) -> () #

NFData (DayOfWeek Julian) Source # 
Instance details

Defined in Data.HodaTime.Calendar.Julian

Methods

rnf :: DayOfWeek Julian -> () #

NFData (DayOfWeek Persian) Source # 
Instance details

Defined in Data.HodaTime.Calendar.Persian

Methods

rnf :: DayOfWeek Persian -> () #

Eq (DayOfWeek Coptic) Source # 
Instance details

Defined in Data.HodaTime.Calendar.Coptic

Eq (DayOfWeek Gregorian) Source # 
Instance details

Defined in Data.HodaTime.Calendar.Gregorian.Internal

Eq (DayOfWeek (Hebrew n)) Source # 
Instance details

Defined in Data.HodaTime.Calendar.Hebrew

Methods

(==) :: DayOfWeek (Hebrew n) -> DayOfWeek (Hebrew n) -> Bool #

(/=) :: DayOfWeek (Hebrew n) -> DayOfWeek (Hebrew n) -> Bool #

Eq (DayOfWeek (Islamic l)) Source # 
Instance details

Defined in Data.HodaTime.Calendar.Islamic

Eq (DayOfWeek Julian) Source # 
Instance details

Defined in Data.HodaTime.Calendar.Julian

Eq (DayOfWeek Persian) Source # 
Instance details

Defined in Data.HodaTime.Calendar.Persian

Ord (DayOfWeek Coptic) Source # 
Instance details

Defined in Data.HodaTime.Calendar.Coptic

Ord (DayOfWeek Gregorian) Source # 
Instance details

Defined in Data.HodaTime.Calendar.Gregorian.Internal

Ord (DayOfWeek (Hebrew n)) Source # 
Instance details

Defined in Data.HodaTime.Calendar.Hebrew

Ord (DayOfWeek (Islamic l)) Source # 
Instance details

Defined in Data.HodaTime.Calendar.Islamic

Ord (DayOfWeek Julian) Source # 
Instance details

Defined in Data.HodaTime.Calendar.Julian

Ord (DayOfWeek Persian) Source # 
Instance details

Defined in Data.HodaTime.Calendar.Persian

Hashable (DayOfWeek Coptic) Source # 
Instance details

Defined in Data.HodaTime.Calendar.Coptic

Hashable (DayOfWeek Gregorian) Source # 
Instance details

Defined in Data.HodaTime.Calendar.Gregorian.Internal

Hashable (DayOfWeek (Hebrew n)) Source # 
Instance details

Defined in Data.HodaTime.Calendar.Hebrew

Methods

hashWithSalt :: Int -> DayOfWeek (Hebrew n) -> Int #

hash :: DayOfWeek (Hebrew n) -> Int #

Hashable (DayOfWeek (Islamic l)) Source # 
Instance details

Defined in Data.HodaTime.Calendar.Islamic

Hashable (DayOfWeek Julian) Source # 
Instance details

Defined in Data.HodaTime.Calendar.Julian

Hashable (DayOfWeek Persian) Source # 
Instance details

Defined in Data.HodaTime.Calendar.Persian

data DayOfWeek Coptic Source # 
Instance details

Defined in Data.HodaTime.Calendar.Coptic

data DayOfWeek Gregorian Source # 
Instance details

Defined in Data.HodaTime.Calendar.Gregorian.Internal

data DayOfWeek Julian Source # 
Instance details

Defined in Data.HodaTime.Calendar.Julian

data DayOfWeek Persian Source # 
Instance details

Defined in Data.HodaTime.Calendar.Persian

data DayOfWeek (Hebrew n) Source # 
Instance details

Defined in Data.HodaTime.Calendar.Hebrew

data DayOfWeek (Islamic l) Source # 
Instance details

Defined in Data.HodaTime.Calendar.Islamic

data Islamic (l :: LeapPattern) Source #

The Islamic (Hijri) calendar, parameterised by its leap-year pattern (see LeapPattern and the module header).

Instances

Instances details
Bounded (DayOfWeek (Islamic l)) Source # 
Instance details

Defined in Data.HodaTime.Calendar.Islamic

Bounded (Month (Islamic l)) Source # 
Instance details

Defined in Data.HodaTime.Calendar.Islamic

Enum (DayOfWeek (Islamic l)) Source # 
Instance details

Defined in Data.HodaTime.Calendar.Islamic

Enum (Month (Islamic l)) Source # 
Instance details

Defined in Data.HodaTime.Calendar.Islamic

Read (DayOfWeek (Islamic l)) Source # 
Instance details

Defined in Data.HodaTime.Calendar.Islamic

Read (Month (Islamic l)) Source # 
Instance details

Defined in Data.HodaTime.Calendar.Islamic

Show (DayOfWeek (Islamic l)) Source # 
Instance details

Defined in Data.HodaTime.Calendar.Islamic

Show (Month (Islamic l)) Source # 
Instance details

Defined in Data.HodaTime.Calendar.Islamic

Methods

showsPrec :: Int -> Month (Islamic l) -> ShowS #

show :: Month (Islamic l) -> String #

showList :: [Month (Islamic l)] -> ShowS #

NFData (DayOfWeek (Islamic l)) Source # 
Instance details

Defined in Data.HodaTime.Calendar.Islamic

Methods

rnf :: DayOfWeek (Islamic l) -> () #

NFData (Month (Islamic l)) Source # 
Instance details

Defined in Data.HodaTime.Calendar.Islamic

Methods

rnf :: Month (Islamic l) -> () #

Eq (DayOfWeek (Islamic l)) Source # 
Instance details

Defined in Data.HodaTime.Calendar.Islamic

Eq (Month (Islamic l)) Source # 
Instance details

Defined in Data.HodaTime.Calendar.Islamic

Methods

(==) :: Month (Islamic l) -> Month (Islamic l) -> Bool #

(/=) :: Month (Islamic l) -> Month (Islamic l) -> Bool #

Ord (DayOfWeek (Islamic l)) Source # 
Instance details

Defined in Data.HodaTime.Calendar.Islamic

Ord (Month (Islamic l)) Source # 
Instance details

Defined in Data.HodaTime.Calendar.Islamic

Methods

compare :: Month (Islamic l) -> Month (Islamic l) -> Ordering #

(<) :: Month (Islamic l) -> Month (Islamic l) -> Bool #

(<=) :: Month (Islamic l) -> Month (Islamic l) -> Bool #

(>) :: Month (Islamic l) -> Month (Islamic l) -> Bool #

(>=) :: Month (Islamic l) -> Month (Islamic l) -> Bool #

max :: Month (Islamic l) -> Month (Islamic l) -> Month (Islamic l) #

min :: Month (Islamic l) -> Month (Islamic l) -> Month (Islamic l) #

Hashable (DayOfWeek (Islamic l)) Source # 
Instance details

Defined in Data.HodaTime.Calendar.Islamic

Hashable (Month (Islamic l)) Source # 
Instance details

Defined in Data.HodaTime.Calendar.Islamic

Methods

hashWithSalt :: Int -> Month (Islamic l) -> Int #

hash :: Month (Islamic l) -> Int #

KnownLeap l => IsCalendar (Islamic l) Source # 
Instance details

Defined in Data.HodaTime.Calendar.Islamic

Associated Types

data Date (Islamic l)

data DayOfWeek (Islamic l) Source #

data Month (Islamic l) Source #

Methods

fromDays :: Int32 -> Date (Islamic l)

toDays :: Date (Islamic l) -> Int32

toYmd :: Date (Islamic l) -> (Int32, Word8, Word8)

calendarName :: Date (Islamic l) -> String

day' :: Date (Islamic l) -> DayOfMonth

setDay' :: DayOfMonth -> Date (Islamic l) -> Date (Islamic l)

month' :: Date (Islamic l) -> Month (Islamic l)

setMonthIndex' :: Int -> Date (Islamic l) -> Date (Islamic l)

year' :: Date (Islamic l) -> Year

setYear' :: Year -> Date (Islamic l) -> Date (Islamic l)

dayOfWeek' :: Date (Islamic l) -> DayOfWeek (Islamic l)

next' :: Int -> DayOfWeek (Islamic l) -> Date (Islamic l) -> Date (Islamic l)

previous' :: Int -> DayOfWeek (Islamic l) -> Date (Islamic l) -> Date (Islamic l)

data DayOfWeek (Islamic l) Source # 
Instance details

Defined in Data.HodaTime.Calendar.Islamic

data Month (Islamic l) Source # 
Instance details

Defined in Data.HodaTime.Calendar.Islamic

data LeapPattern Source #

The four tabular leap-year patterns in common use, used as the (kind-LeapPattern) type parameter of Islamic. Each names which 11 of the 30 cycle years carry the extra day; Base16 is the .NET BCL / NodaTime default (see the module header).

class KnownLeap (l :: LeapPattern) Source #

Reflects a LeapPattern type down to its leap-year bit set: bit n is set when year n of the 30-year cycle (0-based, so year `mod` 30) is a leap year. Use TypeApplications to read it, e.g. leapPatternBits @Base16.

Minimal complete definition

leapPatternBits

Instances

Instances details
KnownLeap 'Base15 Source # 
Instance details

Defined in Data.HodaTime.Calendar.Islamic

KnownLeap 'Base16 Source # 
Instance details

Defined in Data.HodaTime.Calendar.Islamic

KnownLeap 'HabashAlHasib Source # 
Instance details

Defined in Data.HodaTime.Calendar.Islamic

KnownLeap 'Indian Source # 
Instance details

Defined in Data.HodaTime.Calendar.Islamic

Named calendars (leap-pattern type synonyms)

type IslamicBcl = Islamic 'Base16 Source #

The default Islamic calendar: the Base16 leap pattern, matching the .NET BCL HijriCalendar and NodaTime's IslamicBcl.

type IslamicBase15 = Islamic 'Base15 Source #

The Base15 tabular calendar.

type IslamicBase16 = Islamic 'Base16 Source #

The Base16 tabular calendar (same as IslamicBcl).

type IslamicIndian = Islamic 'Indian Source #

The Indian tabular calendar.

type IslamicHabashAlHasib = Islamic 'HabashAlHasib Source #

The Habash al-Hasib tabular calendar.