mirror of
https://github.com/acamarata/dayjs-hijri-plus.git
synced 2026-07-03 20:20:39 +00:00
style: fix prettier table formatting in wiki
This commit is contained in:
parent
862ee41be5
commit
db42550d3f
2 changed files with 40 additions and 33 deletions
|
|
@ -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.
|
Convert the Day.js date to a Hijri date.
|
||||||
|
|
||||||
**Signature:**
|
**Signature:**
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
toHijri(opts?: ConversionOptions): HijriDate | null
|
toHijri(opts?: ConversionOptions): HijriDate | null
|
||||||
```
|
```
|
||||||
|
|
@ -27,7 +28,7 @@ toHijri(opts?: ConversionOptions): HijriDate | null
|
||||||
**Parameters:**
|
**Parameters:**
|
||||||
|
|
||||||
| Name | Type | Default | Description |
|
| Name | Type | Default | Description |
|
||||||
| --- | --- | --- | --- |
|
| --------------- | -------- | ------- | ------------------------------------------------ |
|
||||||
| `opts.calendar` | `string` | `'uaq'` | Calendar engine id. Built-ins: `'uaq'`, `'fcna'` |
|
| `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.
|
**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.
|
Check whether the date has a valid Hijri representation in the supported range.
|
||||||
|
|
||||||
**Signature:**
|
**Signature:**
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
isValidHijri(opts?: ConversionOptions): boolean
|
isValidHijri(opts?: ConversionOptions): boolean
|
||||||
```
|
```
|
||||||
|
|
@ -58,6 +60,7 @@ Returns `false` for dates outside the coverage range, `true` otherwise.
|
||||||
### `.hijriYear(opts?)`
|
### `.hijriYear(opts?)`
|
||||||
|
|
||||||
**Signature:**
|
**Signature:**
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
hijriYear(opts?: ConversionOptions): number | null
|
hijriYear(opts?: ConversionOptions): number | null
|
||||||
```
|
```
|
||||||
|
|
@ -69,6 +72,7 @@ Returns the Hijri year, or `null` if out of range.
|
||||||
### `.hijriMonth(opts?)`
|
### `.hijriMonth(opts?)`
|
||||||
|
|
||||||
**Signature:**
|
**Signature:**
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
hijriMonth(opts?: ConversionOptions): number | null
|
hijriMonth(opts?: ConversionOptions): number | null
|
||||||
```
|
```
|
||||||
|
|
@ -80,6 +84,7 @@ Returns the Hijri month (1-12), or `null` if out of range.
|
||||||
### `.hijriDay(opts?)`
|
### `.hijriDay(opts?)`
|
||||||
|
|
||||||
**Signature:**
|
**Signature:**
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
hijriDay(opts?: ConversionOptions): number | null
|
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.
|
Format the date using a mix of Hijri-specific tokens and standard Day.js tokens.
|
||||||
|
|
||||||
**Signature:**
|
**Signature:**
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
formatHijri(formatStr: string, opts?: ConversionOptions): string
|
formatHijri(formatStr: string, opts?: ConversionOptions): string
|
||||||
```
|
```
|
||||||
|
|
@ -100,7 +106,7 @@ formatHijri(formatStr: string, opts?: ConversionOptions): string
|
||||||
**Parameters:**
|
**Parameters:**
|
||||||
|
|
||||||
| Name | Type | Description |
|
| Name | Type | Description |
|
||||||
| --- | --- | --- |
|
| ----------- | ------------------- | ------------------------------------------------------------- |
|
||||||
| `formatStr` | `string` | Format string containing Hijri tokens, Day.js tokens, or both |
|
| `formatStr` | `string` | Format string containing Hijri tokens, Day.js tokens, or both |
|
||||||
| `opts` | `ConversionOptions` | Optional calendar selection |
|
| `opts` | `ConversionOptions` | Optional calendar selection |
|
||||||
|
|
||||||
|
|
@ -109,7 +115,7 @@ Returns an empty string if the date is outside the supported range.
|
||||||
**Hijri tokens:**
|
**Hijri tokens:**
|
||||||
|
|
||||||
| Token | Example | Description |
|
| Token | Example | Description |
|
||||||
| --- | --- | --- |
|
| ------- | ---------------- | -------------------------------- |
|
||||||
| `iYYYY` | `1444` | 4-digit Hijri year |
|
| `iYYYY` | `1444` | 4-digit Hijri year |
|
||||||
| `iYY` | `44` | 2-digit Hijri year |
|
| `iYY` | `44` | 2-digit Hijri year |
|
||||||
| `iMMMM` | `Ramadan` | Full month name |
|
| `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.
|
Construct a Day.js instance from a Hijri date.
|
||||||
|
|
||||||
**Signature:**
|
**Signature:**
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
dayjs.fromHijri(
|
dayjs.fromHijri(
|
||||||
hy: number,
|
hy: number,
|
||||||
|
|
@ -158,7 +165,7 @@ dayjs.fromHijri(
|
||||||
**Parameters:**
|
**Parameters:**
|
||||||
|
|
||||||
| Name | Type | Description |
|
| Name | Type | Description |
|
||||||
| --- | --- | --- |
|
| --------------- | -------- | ------------------------------------- |
|
||||||
| `hy` | `number` | Hijri year |
|
| `hy` | `number` | Hijri year |
|
||||||
| `hm` | `number` | Hijri month (1-12) |
|
| `hm` | `number` | Hijri month (1-12) |
|
||||||
| `hd` | `number` | Hijri day (1-30) |
|
| `hd` | `number` | Hijri day (1-30) |
|
||||||
|
|
|
||||||
|
|
@ -88,7 +88,7 @@ The package ships a dual CJS/ESM build via tsup. Both `dayjs` and `hijri-core` a
|
||||||
Output:
|
Output:
|
||||||
|
|
||||||
| File | Format |
|
| File | Format |
|
||||||
| --- | --- |
|
| ------------------ | ------------------------------- |
|
||||||
| `dist/index.cjs` | CommonJS (Node `require`) |
|
| `dist/index.cjs` | CommonJS (Node `require`) |
|
||||||
| `dist/index.mjs` | ESM (`import`) |
|
| `dist/index.mjs` | ESM (`import`) |
|
||||||
| `dist/index.d.ts` | TypeScript declarations for CJS |
|
| `dist/index.d.ts` | TypeScript declarations for CJS |
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue