dayjs-hijri-plus/.github/wiki/api/variables/default.md
Aric Camarata 033ca47576 docs: add TypeDoc API generation (typedoc@0.28.19 + typedoc-plugin-markdown@4.11.0)
Add typedoc and typedoc-plugin-markdown as devDependencies. Add typedoc.json config
targeting src/index.ts with markdown output to .github/wiki/api. Add docs script to
package.json. Generate initial API reference pages.

Part of T-E8-03 — TypeDoc automation for all 12 JS/TS packages.
2026-05-30 16:41:59 -04:00

891 B

dayjs-hijri-plus v1.0.1


dayjs-hijri-plus / default

Variable: default

const default: PluginFunc

Defined in: src/index.ts:164

Day.js plugin that adds Hijri calendar support.

Register once with dayjs.extend(hijriPlugin). After that, all dayjs() instances expose .toHijri(), .isValidHijri(), .hijriYear(), .hijriMonth(), .hijriDay(), and .formatHijri(). The static factory dayjs.fromHijri(hy, hm, hd) is also added.

All calendar arithmetic is delegated to hijri-core. This plugin adds no conversion logic of its own.

Example

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

dayjs.extend(hijriPlugin);

dayjs('2023-03-23').toHijri();
// => { hy: 1444, hm: 9, hd: 1 }