moment-hijri-plus/.github/wiki/api/functions/default.md
Aric Camarata b96b21a861 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

45 lines
1.1 KiB
Markdown

[**moment-hijri-plus v1.0.1**](../README.md)
***
[moment-hijri-plus](../README.md) / default
# Function: default()
> **default**(`momentInstance`): `void`
Defined in: [src/index.ts:150](https://github.com/acamarata/moment-hijri-plus/blob/50b666503568cb2ef81d0a7fc2aeefa6cb395aa5/src/index.ts#L150)
Install the Hijri plugin into the provided Moment.js instance.
Mutates `momentInstance.fn` to add instance methods (`toHijri`, `hijriYear`,
`hijriMonth`, `hijriDay`, `isValidHijri`, `formatHijri`) and attaches
`momentInstance.fromHijri` as a static factory. Call once at application startup.
The call is idempotent: calling it a second time overwrites the methods with
identical implementations.
## Parameters
### momentInstance
`__module`
The Moment.js constructor to augment. Pass your imported
`moment` directly. Works with any moment instance, including locale-scoped ones.
## Returns
`void`
## Example
```ts
import moment from 'moment';
import installHijri from 'moment-hijri-plus';
installHijri(moment);
moment(new Date(2023, 2, 23)).toHijri();
// => { hy: 1444, hm: 9, hd: 1 }
```