style: fix prettier table formatting in wiki

This commit is contained in:
Aric Camarata 2026-03-08 17:30:55 -04:00
parent 862ee41be5
commit db42550d3f
2 changed files with 40 additions and 33 deletions

View file

@ -20,6 +20,7 @@ Call `dayjs.extend` once, globally. After that, every Day.js instance has the pl
Convert the Day.js date to a Hijri date.
**Signature:**
```ts
toHijri(opts?: ConversionOptions): HijriDate | null
```
@ -27,7 +28,7 @@ toHijri(opts?: ConversionOptions): HijriDate | null
**Parameters:**
| Name | Type | Default | Description |
| --- | --- | --- | --- |
| --------------- | -------- | ------- | ------------------------------------------------ |
| `opts.calendar` | `string` | `'uaq'` | Calendar engine id. Built-ins: `'uaq'`, `'fcna'` |
**Returns:** `{ hy: number, hm: number, hd: number }` or `null` if the date is outside the table range.
@ -47,6 +48,7 @@ dayjs('2023-03-23').toHijri({ calendar: 'fcna' });
Check whether the date has a valid Hijri representation in the supported range.
**Signature:**
```ts
isValidHijri(opts?: ConversionOptions): boolean
```
@ -58,6 +60,7 @@ Returns `false` for dates outside the coverage range, `true` otherwise.
### `.hijriYear(opts?)`
**Signature:**
```ts
hijriYear(opts?: ConversionOptions): number | null
```
@ -69,6 +72,7 @@ Returns the Hijri year, or `null` if out of range.
### `.hijriMonth(opts?)`
**Signature:**
```ts
hijriMonth(opts?: ConversionOptions): number | null
```
@ -80,6 +84,7 @@ Returns the Hijri month (1-12), or `null` if out of range.
### `.hijriDay(opts?)`
**Signature:**
```ts
hijriDay(opts?: ConversionOptions): number | null
```
@ -93,6 +98,7 @@ Returns the Hijri day (1-30), or `null` if out of range.
Format the date using a mix of Hijri-specific tokens and standard Day.js tokens.
**Signature:**
```ts
formatHijri(formatStr: string, opts?: ConversionOptions): string
```
@ -100,7 +106,7 @@ formatHijri(formatStr: string, opts?: ConversionOptions): string
**Parameters:**
| Name | Type | Description |
| --- | --- | --- |
| ----------- | ------------------- | ------------------------------------------------------------- |
| `formatStr` | `string` | Format string containing Hijri tokens, Day.js tokens, or both |
| `opts` | `ConversionOptions` | Optional calendar selection |
@ -109,7 +115,7 @@ Returns an empty string if the date is outside the supported range.
**Hijri tokens:**
| Token | Example | Description |
| --- | --- | --- |
| ------- | ---------------- | -------------------------------- |
| `iYYYY` | `1444` | 4-digit Hijri year |
| `iYY` | `44` | 2-digit Hijri year |
| `iMMMM` | `Ramadan` | Full month name |
@ -146,6 +152,7 @@ dayjs('2023-03-23').formatHijri('iYYYY YYYY');
Construct a Day.js instance from a Hijri date.
**Signature:**
```ts
dayjs.fromHijri(
hy: number,
@ -158,7 +165,7 @@ dayjs.fromHijri(
**Parameters:**
| Name | Type | Description |
| --- | --- | --- |
| --------------- | -------- | ------------------------------------- |
| `hy` | `number` | Hijri year |
| `hm` | `number` | Hijri month (1-12) |
| `hd` | `number` | Hijri day (1-30) |

View file

@ -88,7 +88,7 @@ The package ships a dual CJS/ESM build via tsup. Both `dayjs` and `hijri-core` a
Output:
| File | Format |
| --- | --- |
| ------------------ | ------------------------------- |
| `dist/index.cjs` | CommonJS (Node `require`) |
| `dist/index.mjs` | ESM (`import`) |
| `dist/index.d.ts` | TypeScript declarations for CJS |