No description
Find a file
2026-05-31 08:47:50 -04:00
.github docs: update TypeDoc sidebar and CI coverage job (pending from prior wave) 2026-05-30 18:32:26 -04:00
src ci: fix eslint config files pattern, add @typescript-eslint direct devDeps, fix prettier formatting 2026-05-31 08:47:50 -04:00
.editorconfig refactor: code quality improvements across the board 2026-03-08 11:37:32 -04:00
.gitignore refactor: code quality improvements across the board 2026-03-08 11:37:32 -04:00
.npmrc chore: clear .npmrc to remove pnpm-only key that warns on npm publish 2026-02-25 15:09:06 -05:00
.nvmrc feat: initial release of date-fns-hijri v1.0.0 2026-02-25 14:15:24 -05:00
CHANGELOG.md chore: bump to v1.0.2 2026-05-30 19:12:47 -04:00
eslint.config.mjs ci: fix eslint config files pattern, add @typescript-eslint direct devDeps, fix prettier formatting 2026-05-31 08:47:50 -04:00
LICENSE feat: initial release of date-fns-hijri v1.0.0 2026-02-25 14:15:24 -05:00
package.json ci: fix eslint config files pattern, add @typescript-eslint direct devDeps, fix prettier formatting 2026-05-31 08:47:50 -04:00
pnpm-lock.yaml ci: fix eslint config files pattern, add @typescript-eslint direct devDeps, fix prettier formatting 2026-05-31 08:47:50 -04:00
pnpm-workspace.yaml feat: initial release of date-fns-hijri v1.0.0 2026-02-25 14:15:24 -05:00
README.md docs: replace em-dash connectors per writing standard 2026-05-30 18:49:07 -04:00
test-cjs.cjs refactor: code quality improvements across the board 2026-03-08 11:37:32 -04:00
test.mjs refactor: code quality improvements across the board 2026-03-08 11:37:32 -04:00
tsconfig.json chore: adopt shared config packages (tsconfig, eslint, prettier) 2026-05-30 15:09:58 -04:00
tsup.config.ts ci: pin pnpm to version 10 in all CI jobs 2026-03-08 16:37:38 -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

date-fns-hijri

npm version CI License: MIT

date-fns-style functions for Hijri calendar operations. Each function is a pure, stateless utility. Pass a Date, get a result. No classes, no global configuration.

Built on hijri-core. Supports Umm al-Qura (UAQ) and FCNA/ISNA calendar systems.

Installation

pnpm add date-fns-hijri hijri-core

hijri-core is a peer dependency. It provides the underlying calendar engine.

Quick Start

import {
  toHijriDate,
  fromHijriDate,
  formatHijriDate,
  addHijriMonths,
  getHijriMonthName,
} from 'date-fns-hijri';

// Convert Gregorian to Hijri
const hijri = toHijriDate(new Date(2023, 2, 23, 12));
// { hy: 1444, hm: 9, hd: 1 } (1 Ramadan 1444)

// Format with Hijri tokens
const label = formatHijriDate(new Date(2023, 2, 23, 12), 'iD iMMMM iYYYY ioooo');
// '1 Ramadan 1444 AH'

// Add Hijri months
const eid = addHijriMonths(new Date(2023, 2, 23, 12), 1);
// Date in Shawwal 1444

// Get the month name
getHijriMonthName(9); // 'Ramadan'

Documentation

Full API reference, guides, and examples: Wiki

Compatibility

  • Node.js 20, 22, 24
  • ESM and CJS builds included
  • TypeScript definitions bundled
  • Works in browsers and all major bundlers

License

MIT. Copyright (c) 2026 Aric Camarata.