Bug: uaqToHijri read local date components (getFullYear/getMonth/getDate)
and passed them to Date.UTC(), producing a UTC midnight that does not match
the input's intended Gregorian day on hosts west of UTC. Concretely, a Date
returned by toGregorian() (UTC midnight) would map to the *previous* Hijri
day on UTC-5 or UTC-13 hosts, breaking the toHijri(toGregorian(hy,hm,hd))
round-trip.
Fix: switch line 44 to read UTC components (getUTCFullYear/getUTCMonth/
getUTCDate), matching how the FCNA engine already worked. Both engines now
share the same UTC-day contract: toHijri reads the UTC calendar day of the
input, and toGregorian returns a UTC-midnight Date. Round-trips are exact;
results are host-timezone-independent.
Behavior change: on non-UTC hosts, toHijri results may shift to the UTC
calendar day rather than the local calendar day. Users passing local
wall-clock dates should use new Date(Date.UTC(y, m-1, d)).
Also:
- Fix misleading comment in uaqToHijri (previously claimed local components
were "timezone-safe")
- Add UTC-day contract to toHijri JSDoc in src/index.ts
- Fix wrong constraint comment in hijri-core.test.ts header
- Add "day boundaries (UTC contract)" describe block to vitest suite
- Convert LOCAL Date constructors in test.mjs and test-cjs.cjs to
Date.UTC() form; add UAQ round-trip assertion to test.mjs
- Add "Day boundaries and time zones" section to README.md
- Add [Unreleased] Fixed entry to CHANGELOG.md
- Add @typescript-eslint/parser and @typescript-eslint/eslint-plugin to
devDependencies (required by eslint.config.mjs direct imports and by
@acamarata/eslint-config peerDependencies)
- Fix eslint.config.mjs: scope files to src/**/*.ts, add parserOptions.project
for type-aware rules, expand ignores to cover coverage/ and docs/
- Run prettier --write src/ to fix format:check failures
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.
Remove empty dependencies field from package.json. Add JSDoc to
CalendarEngine.toGregorian clarifying null-return contract. Fix
documentation style in source comments and wiki (no em dashes).
Tighten test output format in test.mjs and test-cjs.cjs.
The index module registers built-in calendar engines at load time via
registerCalendar(). sideEffects:false was incorrect and could cause
bundlers to tree-shake those registration calls. Mark only the dist
entry points as having side effects so tree-shaking still works for
everything else.
Zero-dependency Hijri calendar engine with pluggable calendar registry.
Built-in Umm al-Qura (UAQ) and FCNA/ISNA calendar engines. Supports N
additional calendars via registerCalendar(). Pure Date.UTC arithmetic,
binary search on 184-entry UAQ table, Meeus Ch.49 new moon formula for
FCNA. 39 ESM + 20 CJS tests passing. Dual CJS/ESM build with full TypeScript
declarations.