mirror of
https://github.com/acamarata/date-fns-hijri.git
synced 2026-06-30 18:54:25 +00:00
Functional Hijri date utility library in date-fns style. 17 exported functions: toHijriDate, fromHijriDate, isValidHijriDate, getHijriYear, getHijriMonth, getHijriDay, getDaysInHijriMonth, getHijriMonthName, getHijriWeekdayName, formatHijriDate, addHijriMonths, addHijriYears, startOfHijriMonth, endOfHijriMonth, isSameHijriMonth, isSameHijriYear, getHijriQuarter. All delegate to hijri-core. UTC-midnight-to-local-noon correction applied in arithmetic functions to avoid timezone boundary drift. 55 ESM + 10 CJS tests passing. Dual CJS/ESM build.
1.7 KiB
1.7 KiB
Changelog
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
[1.0.0] - 2026-02-25
Added
toHijriDate(date, options?)- Convert a Gregorian Date to a HijriDate objectfromHijriDate(hy, hm, hd, options?)- Convert Hijri date components to a Gregorian DateisValidHijriDate(hy, hm, hd, options?)- Validate a Hijri dategetHijriYear(date, options?)- Extract the Hijri year from a Gregorian dategetHijriMonth(date, options?)- Extract the Hijri month (1-12) from a Gregorian dategetHijriDay(date, options?)- Extract the Hijri day of month from a Gregorian dategetDaysInHijriMonth(hy, hm, options?)- Days in a given Hijri month (29 or 30)getHijriMonthName(hm, length?)- English month name in long, medium, or short formgetHijriWeekdayName(date, length?)- Arabic weekday name (long or short)formatHijriDate(date, formatStr, options?)- Format a date with Hijri tokensaddHijriMonths(date, months, options?)- Add Hijri months to a dateaddHijriYears(date, years, options?)- Add Hijri years to a datestartOfHijriMonth(date, options?)- First day of the Hijri monthendOfHijriMonth(date, options?)- Last day of the Hijri monthisSameHijriMonth(dateA, dateB, options?)- Check if two dates share a Hijri monthisSameHijriYear(dateA, dateB, options?)- Check if two dates share a Hijri yeargetHijriQuarter(date, options?)- Hijri quarter (1-4) for a date- Full TypeScript definitions with dual CJS/ESM build
- Support for Umm al-Qura (UAQ) and FCNA/ISNA calendar systems via
hijri-core