No description
Find a file
2026-05-31 08:50:45 -04:00
.github chore: P1 standardization — finalize src/wiki/ci 2026-05-30 18:48:59 -04:00
coverage chore: P1 standardization — finalize src/wiki/ci 2026-05-30 18:48:59 -04:00
src ci: format all files with prettier to fix format:check 2026-05-31 08:50:45 -04:00
.editorconfig refactor: code quality improvements and Temporal Protocol compliance 2026-03-08 11:37:22 -04:00
.gitignore refactor: code quality improvements and Temporal Protocol compliance 2026-03-08 11:37:22 -04:00
.npmrc chore: clear .npmrc to remove pnpm-only key that warns on npm publish 2026-02-25 15:09:09 -05:00
.nvmrc feat: initial release of temporal-hijri v1.0.0 2026-02-25 14:17:27 -05:00
CHANGELOG.md chore: bump to v1.0.2 2026-05-30 19:21:29 -04:00
eslint.config.mjs ci: format all files with prettier to fix format:check 2026-05-31 08:50:45 -04:00
LICENSE feat: initial release of temporal-hijri v1.0.0 2026-02-25 14:17:27 -05:00
package.json ci: fix eslint - add @typescript-eslint/parser and eslint-plugin as explicit devDeps 2026-05-31 08:47:02 -04:00
pnpm-lock.yaml ci: fix eslint - add @typescript-eslint/parser and eslint-plugin as explicit devDeps 2026-05-31 08:47:02 -04:00
pnpm-workspace.yaml feat: initial release of temporal-hijri v1.0.0 2026-02-25 14:17:27 -05:00
README.md chore: P1 standardization — finalize src/wiki/ci 2026-05-30 18:48:59 -04:00
test-cjs.cjs ci: format all files with prettier to fix format:check 2026-05-31 08:50:45 -04:00
test.mjs ci: format all files with prettier to fix format:check 2026-05-31 08:50:45 -04:00
tsconfig.json chore: adopt shared config packages (tsconfig, eslint, prettier) 2026-05-30 15:12:16 -04:00
tsup.config.ts ci: format all files with prettier to fix format:check 2026-05-31 08:50:45 -04:00
typedoc.json docs: add TypeDoc API generation (typedoc@0.28.19 + typedoc-plugin-markdown@4.11.0) 2026-05-30 16:41:59 -04:00

npm version CI License: MIT

temporal-hijri

Temporal Calendar Protocol implementation for the Hijri calendar. Works with the TC39 Temporal proposal (Stage 3) and @js-temporal/polyfill.

Provides UaqCalendar (Umm al-Qura) and FcnaCalendar (FCNA/ISNA) as plug-in calendars for Temporal.PlainDate. The underlying conversion logic comes from hijri-core.

Installation

pnpm add temporal-hijri hijri-core
# Add the polyfill if native Temporal is unavailable:
pnpm add @js-temporal/polyfill

Quick Start

import { Temporal } from '@js-temporal/polyfill';
import { uaqCalendar } from 'temporal-hijri';

const isoDate = Temporal.PlainDate.from('2023-03-23');

console.log(uaqCalendar.year(isoDate));      // 1444
console.log(uaqCalendar.month(isoDate));     // 9  (Ramadan)
console.log(uaqCalendar.day(isoDate));       // 1

// Convert Hijri coordinates to ISO
const ramadan = uaqCalendar.dateFromFields({ year: 1444, month: 9, day: 1 });
console.log(ramadan.toString()); // "2023-03-23"

// Date arithmetic in Hijri space
const { Duration } = Temporal;
const nextMonth = uaqCalendar.dateAdd(isoDate, new Duration(0, 1));
console.log(uaqCalendar.month(nextMonth)); // 10 (Shawwal)

Calendars

Calendar ID Authority Method Coverage
Umm al-Qura hijri-uaq KACST, Saudi Arabia Pre-calculated tables 1318-1500 AH
FCNA/ISNA hijri-fcna Fiqh Council of NA Astronomical new moon Unbounded

Documentation

Full reference in the wiki.

License

MIT. Copyright (c) 2026 Aric Camarata. See LICENSE.