No description
Find a file
2026-05-30 19:18:58 -04:00
.github chore: E6 polish wiki + CI + TypeDoc integration (P1) 2026-05-30 18:38:38 -04:00
src chore: E6 polish wiki + CI + TypeDoc integration (P1) 2026-05-30 18:38:38 -04:00
.editorconfig refactor: code quality improvements across the board 2026-03-08 11:37:44 -04:00
.gitignore refactor: code quality improvements across the board 2026-03-08 11:37:44 -04:00
.npmrc chore: clear .npmrc to remove pnpm-only key that warns on npm publish 2026-02-25 15:09:07 -05:00
.nvmrc feat: initial release of dayjs-hijri-plus v1.0.0 2026-02-25 14:15:07 -05:00
CHANGELOG.md chore: bump to v1.0.2 2026-05-30 19:18:58 -04:00
eslint.config.mjs chore: adopt shared config packages (tsconfig, eslint, prettier) 2026-05-30 15:10:42 -04:00
LICENSE feat: initial release of dayjs-hijri-plus v1.0.0 2026-02-25 14:15:07 -05:00
package.json chore: bump to v1.0.2 2026-05-30 19:18: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:59 -04:00
pnpm-workspace.yaml feat: initial release of dayjs-hijri-plus v1.0.0 2026-02-25 14:15:07 -05:00
README.md chore: E6 polish wiki + CI + TypeDoc integration (P1) 2026-05-30 18:38:38 -04:00
test-cjs.cjs refactor: code quality improvements across the board 2026-03-08 11:37:44 -04:00
test.mjs refactor: code quality improvements across the board 2026-03-08 11:37:44 -04:00
tsconfig.json chore: adopt shared config packages (tsconfig, eslint, prettier) 2026-05-30 15:10:42 -04:00
tsup.config.ts ci: pin pnpm to version 10 in all CI jobs 2026-03-08 16:37:41 -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

dayjs-hijri-plus

npm version CI License: MIT

A Day.js plugin that adds Hijri calendar support. Converts Gregorian dates to and from Hijri, provides Hijri-aware formatting, and delegates all calendar logic to hijri-core.

Supports Umm al-Qura (UAQ) and FCNA/ISNA calendars. Custom engines can be registered at runtime.

Installation

pnpm add dayjs dayjs-hijri-plus hijri-core

Both dayjs and hijri-core are peer dependencies.

Quick Start

import dayjs from 'dayjs';
import hijriPlugin from 'dayjs-hijri-plus';

dayjs.extend(hijriPlugin);

const d = dayjs('2023-03-23');
d.toHijri();                              // { hy: 1444, hm: 9, hd: 1 }
d.formatHijri('iD iMMMM iYYYY');         // '1 Ramadan 1444'
d.formatHijri('iYYYY-iMM-iDD');          // '1444-09-01'

dayjs.fromHijri(1444, 10, 1).format('YYYY-MM-DD'); // '2023-04-21'

Documentation

Full API reference, examples, and architecture notes are on the GitHub Wiki.

  • hijri-core: the zero-dependency Hijri calendar engine this plugin wraps
  • luxon-hijri: the same conversion for Luxon users
  • pray-calc: Islamic prayer time calculation

License

MIT. Copyright (c) 2026 Aric Camarata.