From 536f1c5189e4ee196861c472aa43c79ef65b9a5b Mon Sep 17 00:00:00 2001 From: Aric Camarata Date: Wed, 25 Feb 2026 15:14:11 -0500 Subject: [PATCH] chore: CR/QA polish for v1.0.0 release Fix documentation style (no em dashes). Update hijri-core devDep from file: path to ^1.0.0. --- .wiki/API-Reference.md | 12 ++++++------ .wiki/Home.md | 4 ++-- README.md | 4 ++-- package.json | 2 +- pnpm-lock.yaml | 10 +++++----- src/index.ts | 6 +++--- 6 files changed, 19 insertions(+), 19 deletions(-) diff --git a/.wiki/API-Reference.md b/.wiki/API-Reference.md index a3f6a98..76f6a36 100644 --- a/.wiki/API-Reference.md +++ b/.wiki/API-Reference.md @@ -20,7 +20,7 @@ function toHijriDate(date: Date, options?: ConversionOptions): HijriDate | null Convert a Gregorian `Date` to a Hijri date object. -Returns `null` when the date falls outside the calendar's supported range. UAQ covers 1356-1500 AH (approximately 1937-2077 CE). +Returns `null` when the date falls outside the calendar's supported range. UAQ covers 1318-1500 AH (approximately 1900-2076 CE). **Parameters:** @@ -37,10 +37,10 @@ Returns `null` when the date falls outside the calendar's supported range. UAQ c import { toHijriDate } from 'date-fns-hijri'; toHijriDate(new Date(2023, 2, 23, 12)); -// { hy: 1444, hm: 9, hd: 1 } — 1 Ramadan 1444 +// { hy: 1444, hm: 9, hd: 1 } - 1 Ramadan 1444 toHijriDate(new Date(1800, 0, 1)); -// null — out of range +// null - out of range ``` --- @@ -96,8 +96,8 @@ Check whether a Hijri date is valid. Verifies year, month (1-12), and day (1-day ```typescript isValidHijriDate(1444, 9, 1); // true -isValidHijriDate(1444, 13, 1); // false — no month 13 -isValidHijriDate(1444, 9, 31); // false — Ramadan has 29 or 30 days +isValidHijriDate(1444, 13, 1); // false - no month 13 +isValidHijriDate(1444, 9, 31); // false - Ramadan has 29 or 30 days ``` --- @@ -205,7 +205,7 @@ Get the English name of a Hijri month. | 9 | Ramadan | Ramadan | Ram | | 10 | Shawwal | Shawwal | Shw | | 11 | Dhul Qi'dah | Dhul-Qidah | DhQ | -| 12 | Dhul Hijjah | Dhul-Hijah | DhH | +| 12 | Dhul Hijjah | Dhul-Hijjah | DhH | --- diff --git a/.wiki/Home.md b/.wiki/Home.md index 36f5dff..d724c73 100644 --- a/.wiki/Home.md +++ b/.wiki/Home.md @@ -28,7 +28,7 @@ const eid = addHijriMonths(new Date(2023, 2, 23, 12), 1); pnpm add date-fns-hijri hijri-core ``` -`hijri-core` is a peer dependency — install it alongside this package. +`hijri-core` is a peer dependency. Install it alongside this package. ## Table of Contents @@ -39,7 +39,7 @@ pnpm add date-fns-hijri hijri-core Two calendar systems are built in: -- **UAQ (default):** Umm al-Qura. Official Saudi Arabia calendar. Tabular data covering 1356-1500 AH. Deterministic. +- **UAQ (default):** Umm al-Qura. Official Saudi Arabia calendar. Tabular data covering 1318-1500 AH (1900-2076 CE). Deterministic. - **FCNA:** Fiqh Council of North America. Astronomical calculation. Extends slightly beyond UAQ's range. Switch calendar system with the `options` argument: diff --git a/README.md b/README.md index 77387d8..bb88365 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ import { // Convert a Gregorian date to Hijri const hijri = toHijriDate(new Date(2023, 2, 23)); -// { hy: 1444, hm: 9, hd: 1 } — 1 Ramadan 1444 +// { hy: 1444, hm: 9, hd: 1 } - 1 Ramadan 1444 // Convert back const gregorian = fromHijriDate(1444, 9, 1); @@ -114,7 +114,7 @@ All functions accept an optional `options` argument for selecting the calendar s Two calendar systems are available via the `options.calendar` property. **Umm al-Qura (default):** -The official calendar of Saudi Arabia. Covers 1356–1500 AH. Tabular data; deterministic. +The official calendar of Saudi Arabia. Covers 1318–1500 AH (1900–2076 CE). Tabular data; deterministic. ```typescript import { toHijriDate } from 'date-fns-hijri'; diff --git a/package.json b/package.json index 4790287..9d656f5 100644 --- a/package.json +++ b/package.json @@ -49,7 +49,7 @@ }, "devDependencies": { "@types/node": "^22.0.0", - "hijri-core": "file:../hijri-core", + "hijri-core": "^1.0.0", "tsup": "^8.0.0", "typescript": "^5.5.0" }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index b91c952..c10ca52 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -12,8 +12,8 @@ importers: specifier: ^22.0.0 version: 22.19.11 hijri-core: - specifier: file:../hijri-core - version: file:../hijri-core + specifier: ^1.0.0 + version: 1.0.0 tsup: specifier: ^8.0.0 version: 8.5.1(typescript@5.9.3) @@ -400,8 +400,8 @@ packages: engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} os: [darwin] - hijri-core@file:../hijri-core: - resolution: {directory: ../hijri-core, type: directory} + hijri-core@1.0.0: + resolution: {integrity: sha512-wImBZLBKbEWEEUE1nrc1CFY/uvx4XjGNWYChImJZlswXIVhrBCzSVaj6DP1AU2gUMJ6KDh2ygXo/u/Qx232CXA==} engines: {node: '>=20'} joycon@3.1.1: @@ -785,7 +785,7 @@ snapshots: fsevents@2.3.3: optional: true - hijri-core@file:../hijri-core: {} + hijri-core@1.0.0: {} joycon@3.1.1: {} diff --git a/src/index.ts b/src/index.ts index 5a42c0a..d9ef2ff 100644 --- a/src/index.ts +++ b/src/index.ts @@ -23,7 +23,7 @@ import type { HijriDate, ConversionOptions } from './types'; * Convert a Gregorian `Date` to a Hijri date object. * * Returns `null` when the date falls outside the calendar's supported range - * (UAQ: 1356–1500 AH; FCNA extends slightly further). + * (UAQ: 1318–1500 AH / 1900–2076 CE; FCNA extends slightly further). */ export function toHijriDate(date: Date, options?: ConversionOptions): HijriDate | null { return coreToHijri(date, options); @@ -104,7 +104,7 @@ export function getHijriDay(date: Date, options?: ConversionOptions): number | n /** * Get the number of days in a Hijri month (29 or 30). * - * @throws {Error} If the year/month combination is outside the calendar's range. + * @throws {RangeError} If the year is outside the calendar's supported range. */ export function getDaysInHijriMonth( hy: number, @@ -159,7 +159,7 @@ export function getHijriWeekdayName( // Formatting // --------------------------------------------------------------------------- -/** Ordered token pattern — longer tokens must appear before shorter prefixes. */ +/** Ordered token pattern: longer tokens appear before shorter prefixes to avoid partial matches. */ const TOKEN_RE = /iYYYY|iYY|iMMMM|iMMM|iMM|iM|iDD|iD|iEEEE|iEEE|iE|ioooo|iooo/g; /**