-
Notifications
You must be signed in to change notification settings - Fork 0
Home
github-actions[bot] edited this page Feb 25, 2026
·
2 revisions
A Moment.js plugin for Hijri calendar conversion and formatting. All calendar arithmetic is handled by hijri-core, keeping this package thin and focused.
- Converts any moment to a Hijri date object (
{ hy, hm, hd }) - Formats moments using Hijri-specific tokens mixed freely with standard Moment format tokens
- Constructs moments from Hijri dates via
moment.fromHijri() - Supports Umm al-Qura (UAQ) and FCNA/ISNA calendars
- API Reference: complete method signatures and examples
- Architecture: design rationale, token system, calendar delegation
pnpm add moment moment-hijri-plus hijri-coreimport moment from 'moment';
import installHijri from 'moment-hijri-plus';
installHijri(moment);
moment(new Date(2023, 2, 23)).toHijri();
// => { hy: 1444, hm: 9, hd: 1 } (1 Ramadan 1444 AH)
moment(new Date(2023, 2, 23)).formatHijri('iD iMMMM iYYYY AH');
// => '1 Ramadan 1444 AH'
moment.fromHijri(1446, 1, 1).format('YYYY-MM-DD');
// => '2024-07-07'- hijri-core: the calendar engine
- luxon-hijri: same support for Luxon
- pray-calc: Islamic prayer time calculation
moment-hijri-plus · MIT License · npm · Issues
Guides
Examples
Reference
- API Reference
- installHijri
- toHijri
- fromHijri
- formatHijri
- hijriYear / hijriMonth / hijriDay
- isValidHijri
- Architecture
- Benchmarks
Community