style: fix prettier table formatting in wiki

This commit is contained in:
Aric Camarata 2026-03-08 17:30:54 -04:00
parent bc32214cee
commit f00656ee20
2 changed files with 77 additions and 77 deletions

View file

@ -15,7 +15,7 @@ interface ConversionOptions {
### `toHijriDate`
```typescript
function toHijriDate(date: Date, options?: ConversionOptions): HijriDate | null
function toHijriDate(date: Date, options?: ConversionOptions): HijriDate | null;
```
Convert a Gregorian `Date` to a Hijri date object.
@ -25,7 +25,7 @@ Returns `null` when the date falls outside the calendar's supported range. UAQ c
**Parameters:**
| Name | Type | Description |
| --- | --- | --- |
| --------- | ------------------- | ----------------------------------- |
| `date` | `Date` | A valid Gregorian date |
| `options` | `ConversionOptions` | Optional. Calendar system selection |
@ -48,7 +48,7 @@ toHijriDate(new Date(1800, 0, 1));
### `fromHijriDate`
```typescript
function fromHijriDate(hy: number, hm: number, hd: number, options?: ConversionOptions): Date
function fromHijriDate(hy: number, hm: number, hd: number, options?: ConversionOptions): Date;
```
Convert a Hijri date to a Gregorian `Date`.
@ -58,7 +58,7 @@ The returned `Date` is set to midnight UTC of the equivalent Gregorian day.
**Parameters:**
| Name | Type | Description |
| --- | --- | --- |
| --------- | ------------------- | ----------------------------------- |
| `hy` | `number` | Hijri year |
| `hm` | `number` | Hijri month (1-12) |
| `hd` | `number` | Hijri day (1-30) |
@ -87,7 +87,7 @@ fromHijriDate(1444, 13, 1);
### `isValidHijriDate`
```typescript
function isValidHijriDate(hy: number, hm: number, hd: number, options?: ConversionOptions): boolean
function isValidHijriDate(hy: number, hm: number, hd: number, options?: ConversionOptions): boolean;
```
Check whether a Hijri date is valid. Verifies year, month (1-12), and day (1-daysInMonth) all exist in the calendar's data table.
@ -107,7 +107,7 @@ isValidHijriDate(1444, 9, 31); // false - Ramadan has 29 or 30 days
### `getHijriYear`
```typescript
function getHijriYear(date: Date, options?: ConversionOptions): number | null
function getHijriYear(date: Date, options?: ConversionOptions): number | null;
```
Get the Hijri year for a Gregorian date. Returns `null` when out of range.
@ -117,7 +117,7 @@ Get the Hijri year for a Gregorian date. Returns `null` when out of range.
### `getHijriMonth`
```typescript
function getHijriMonth(date: Date, options?: ConversionOptions): number | null
function getHijriMonth(date: Date, options?: ConversionOptions): number | null;
```
Get the Hijri month (1-12) for a Gregorian date. Returns `null` when out of range.
@ -127,7 +127,7 @@ Get the Hijri month (1-12) for a Gregorian date. Returns `null` when out of rang
### `getHijriDay`
```typescript
function getHijriDay(date: Date, options?: ConversionOptions): number | null
function getHijriDay(date: Date, options?: ConversionOptions): number | null;
```
Get the Hijri day of month for a Gregorian date. Returns `null` when out of range.
@ -137,7 +137,7 @@ Get the Hijri day of month for a Gregorian date. Returns `null` when out of rang
### `getDaysInHijriMonth`
```typescript
function getDaysInHijriMonth(hy: number, hm: number, options?: ConversionOptions): number
function getDaysInHijriMonth(hy: number, hm: number, options?: ConversionOptions): number;
```
Get the number of days in a Hijri month. Returns 29 or 30.
@ -156,7 +156,7 @@ getDaysInHijriMonth(1444, 1); // 30 (Muharram 1444)
### `getHijriQuarter`
```typescript
function getHijriQuarter(date: Date, options?: ConversionOptions): number | null
function getHijriQuarter(date: Date, options?: ConversionOptions): number | null;
```
Get the Hijri quarter (1-4) for a date. Months 1-3 = Q1, 4-6 = Q2, 7-9 = Q3, 10-12 = Q4.
@ -176,7 +176,7 @@ getHijriQuarter(new Date(2023, 2, 23, 12)); // 3 (Ramadan = month 9 = Q3)
### `getHijriMonthName`
```typescript
function getHijriMonthName(hm: number, length?: 'long' | 'medium' | 'short'): string
function getHijriMonthName(hm: number, length?: 'long' | 'medium' | 'short'): string;
```
Get the English name of a Hijri month.
@ -184,7 +184,7 @@ Get the English name of a Hijri month.
**Parameters:**
| Name | Type | Default | Description |
| --- | --- | --- | --- |
| -------- | ------------------------------- | -------- | ------------------- |
| `hm` | `number` | | Month number (1-12) |
| `length` | `'long' \| 'medium' \| 'short'` | `'long'` | Name length |
@ -193,7 +193,7 @@ Get the English name of a Hijri month.
**Month names by length:**
| Month | Long | Medium | Short |
| --- | --- | --- | --- |
| ----- | ------------- | ----------- | ----- |
| 1 | Muharram | Muharram | Muh |
| 2 | Safar | Safar | Saf |
| 3 | Rabi'l Awwal | Rabi1 | Ra1 |
@ -212,7 +212,7 @@ Get the English name of a Hijri month.
### `getHijriWeekdayName`
```typescript
function getHijriWeekdayName(date: Date, length?: 'long' | 'short'): string
function getHijriWeekdayName(date: Date, length?: 'long' | 'short'): string;
```
Get the Arabic weekday name for a Gregorian date. Uses `Date.getDay()` (0 = Sunday through 6 = Saturday) as the index.
@ -220,7 +220,7 @@ Get the Arabic weekday name for a Gregorian date. Uses `Date.getDay()` (0 = Sund
**Weekday names:**
| JS getDay() | Day | Long | Short |
| --- | --- | --- | --- |
| ----------- | --------- | ------------------ | ----- |
| 0 | Sunday | Yawm al-Ahad | Ahad |
| 1 | Monday | Yawm al-Ithnayn | Ithn |
| 2 | Tuesday | Yawm ath-Thulatha' | Thul |
@ -236,7 +236,7 @@ Get the Arabic weekday name for a Gregorian date. Uses `Date.getDay()` (0 = Sund
### `formatHijriDate`
```typescript
function formatHijriDate(date: Date, formatStr: string, options?: ConversionOptions): string
function formatHijriDate(date: Date, formatStr: string, options?: ConversionOptions): string;
```
Format a Gregorian date using Hijri calendar tokens.
@ -246,7 +246,7 @@ Returns an empty string when the date falls outside the supported range. Non-tok
**Format tokens:**
| Token | Output | Example |
| --- | --- | --- |
| ------- | ------------------------------ | ---------------- |
| `iYYYY` | 4-digit Hijri year | `1444` |
| `iYY` | 2-digit Hijri year | `44` |
| `iMMMM` | Long month name | `Ramadan` |
@ -281,7 +281,7 @@ formatHijriDate(new Date(2023, 2, 23), 'iEEEE');
### `addHijriMonths`
```typescript
function addHijriMonths(date: Date, months: number, options?: ConversionOptions): Date
function addHijriMonths(date: Date, months: number, options?: ConversionOptions): Date;
```
Add a number of Hijri months to a Gregorian date.
@ -305,7 +305,7 @@ addHijriMonths(new Date(2023, 6, 18, 12), 1);
### `addHijriYears`
```typescript
function addHijriYears(date: Date, years: number, options?: ConversionOptions): Date
function addHijriYears(date: Date, years: number, options?: ConversionOptions): Date;
```
Add a number of Hijri years to a Gregorian date.
@ -321,7 +321,7 @@ If the resulting year has fewer days in the same month (e.g., day 30 in a 29-day
### `startOfHijriMonth`
```typescript
function startOfHijriMonth(date: Date, options?: ConversionOptions): Date
function startOfHijriMonth(date: Date, options?: ConversionOptions): Date;
```
Get the first day of the Hijri month that contains the given date.
@ -333,7 +333,7 @@ Get the first day of the Hijri month that contains the given date.
### `endOfHijriMonth`
```typescript
function endOfHijriMonth(date: Date, options?: ConversionOptions): Date
function endOfHijriMonth(date: Date, options?: ConversionOptions): Date;
```
Get the last day of the Hijri month that contains the given date.
@ -358,7 +358,7 @@ const end = endOfHijriMonth(new Date(2023, 3, 1, 12));
### `isSameHijriMonth`
```typescript
function isSameHijriMonth(dateA: Date, dateB: Date, options?: ConversionOptions): boolean
function isSameHijriMonth(dateA: Date, dateB: Date, options?: ConversionOptions): boolean;
```
Check whether two Gregorian dates fall in the same Hijri month.
@ -370,7 +370,7 @@ Returns `false` if either date is outside the supported range.
### `isSameHijriYear`
```typescript
function isSameHijriYear(dateA: Date, dateB: Date, options?: ConversionOptions): boolean
function isSameHijriYear(dateA: Date, dateB: Date, options?: ConversionOptions): boolean;
```
Check whether two Gregorian dates fall in the same Hijri year.

View file

@ -110,7 +110,7 @@ This handles the case where month lengths differ (29 vs 30 days) without requiri
`tsup` produces four outputs from a single source:
| File | Format | Purpose |
| --- | --- | --- |
| ------------------ | ----------------------- | ------------------- |
| `dist/index.cjs` | CommonJS | Node.js `require()` |
| `dist/index.mjs` | ESM | `import` / bundlers |
| `dist/index.d.ts` | TypeScript declarations | CJS consumers |