hijri library

Hijri (Islamic) calendar conversion.

Same as the pakdatakit/hijri entry point of the npm package.

Classes

HijriDate
Islamic (Hijri) date components. See toHijri.

Functions

formatHijri(DateTime date, {int offset = 0}) → String
Formats a Gregorian date as a Hijri date string, e.g. "14 Ramadan 1447". See toHijri for offset.
fromHijri(HijriDate hijri, {int offset = 0}) → DateTime
Converts a Hijri date to a Gregorian date (local midnight).
getHijriMonthName(int month) → String?
Returns the English name of a Hijri month (1–12), or null if month is out of range.
isRamadan(DateTime date, {int offset = 0}) → bool
Whether a Gregorian date falls in the month of Ramadan. See toHijri for offset.
toHijri(DateTime date, {int offset = 0}) → HijriDate
Converts a Gregorian date to a Hijri (Islamic) date.