No description
Find a file
2026-05-30 17:48:47 -04:00
.github docs: refresh TypeDoc API output (T-E8-03 QA-A verify) 2026-05-30 17:48:47 -04:00
src chore: adopt shared config packages (tsconfig, eslint, prettier) 2026-05-30 15:08:47 -04:00
.editorconfig feat: v2.0.0 — FCNA calendar, dual ESM/CJS build, weekday bug fix, full test suite 2026-02-25 13:25:11 -05:00
.gitignore refactor: code quality improvements across the board 2026-03-08 11:42:29 -04:00
.npmrc chore: clear .npmrc to remove pnpm-only key that warns on npm publish 2026-02-25 15:09:10 -05:00
.nvmrc feat: v2.0.0 — FCNA calendar, dual ESM/CJS build, weekday bug fix, full test suite 2026-02-25 13:25:11 -05:00
CHANGELOG.md docs(e6): portfolio polish — README trim, CHANGELOG, wiki pages 2026-05-28 14:00:16 -04:00
eslint.config.mjs chore: adopt shared config packages (tsconfig, eslint, prettier) 2026-05-30 15:08:47 -04:00
LICENSE feat: v2.0.0 — FCNA calendar, dual ESM/CJS build, weekday bug fix, full test suite 2026-02-25 13:25:11 -05:00
package.json docs: add TypeDoc API generation (typedoc@0.28.19 + typedoc-plugin-markdown@4.11.0) 2026-05-30 16:41:58 -04:00
pnpm-lock.yaml docs: add TypeDoc API generation (typedoc@0.28.19 + typedoc-plugin-markdown@4.11.0) 2026-05-30 16:41:58 -04:00
pnpm-workspace.yaml feat: v2.0.0 — FCNA calendar, dual ESM/CJS build, weekday bug fix, full test suite 2026-02-25 13:25:11 -05:00
README.md docs(e6): portfolio polish — README trim, CHANGELOG, wiki pages 2026-05-28 14:00:16 -04:00
test-cjs.cjs refactor: code quality improvements across the board 2026-03-08 11:42:29 -04:00
test-crossval.mjs docs: add quickstart, advanced guide, examples, and cross-validation test for luxon-hijri 2026-05-28 14:14:23 -04:00
test.mjs refactor: code quality improvements across the board 2026-03-08 11:42:29 -04:00
tsconfig.json chore: adopt shared config packages (tsconfig, eslint, prettier) 2026-05-30 15:08:47 -04:00
tsup.config.ts feat: v2.1.0 — delegate engine logic to hijri-core 2026-02-25 14:14:29 -05:00
typedoc.json docs: add TypeDoc API generation (typedoc@0.28.19 + typedoc-plugin-markdown@4.11.0) 2026-05-30 16:41:58 -04:00

luxon-hijri

npm version CI License: MIT

Hijri/Gregorian date conversion and formatting for Luxon users. Thin adapter over hijri-core. Supports the Umm al-Qura calendar (1318-1500 AH, table-based) and the FCNA/ISNA calendar (astronomical, all Hijri years).

Installation

pnpm add luxon-hijri luxon hijri-core
# or
npm install luxon-hijri luxon hijri-core

Quick Start

import { toHijri, toGregorian, formatHijriDate } from 'luxon-hijri';

// Gregorian to Hijri (Umm al-Qura, default)
const h = toHijri(new Date(2023, 2, 23, 12));
// { hy: 1444, hm: 9, hd: 1 }

// Hijri to Gregorian
const g = toGregorian(1444, 9, 1);
// Date: 2023-03-23T00:00:00.000Z

// Format a Hijri date
formatHijriDate({ hy: 1444, hm: 9, hd: 1 }, 'iEEEE, iD iMMMM iYYYY ioooo');
// "Yawm al-Khamis, 1 Ramadan 1444 AH"

// FCNA/ISNA calendar
toHijri(new Date(2025, 2, 1, 12), { calendar: 'fcna' });

TypeScript

import { toHijri, toGregorian, formatHijriDate, isValidHijriDate } from 'luxon-hijri';
import type { HijriDate, CalendarSystem, ConversionOptions } from 'luxon-hijri';

Documentation

Full API reference, format token guide, calendar background, and architecture notes: GitHub Wiki

Acknowledgments

The Umm al-Qura table is derived from data published by KACST (King Abdulaziz City for Science and Technology). The FCNA new moon algorithm follows Jean Meeus, "Astronomical Algorithms," 2nd ed., Chapter 49.

License

MIT. Copyright (c) 2024-2026 Aric Camarata.