HijriCalendar.toHijri() previously used new Date(y, m, d) (local-time
constructor). Under hijri-core's new UTC-day contract the engine reads
the UTC calendar day, so on east-of-UTC hosts (e.g. UTC+5) the local
midnight falls on the previous UTC date, producing a one-day-off Hijri
result.
Fix: use Date.UTC(y, m, d) so PlainDate calendar fields land in the
Date's UTC components, matching what hijri-core reads.
Lock-step dependency: this fix requires the unreleased hijri-core change
on fix/utc-day-boundary (commit 3419378). Both packages will be released
together per ADR-013.
Tests: round-trip regression added (2025-03-01 = 1 Ramadan 1446 AH);
all 37 ESM + 9 CJS tests pass at TZ=UTC, TZ=America/New_York,
TZ=Pacific/Auckland.
- Replace O(n) while-loops in dateAdd() with O(1) modular arithmetic
- Implement overflow option handling in dateFromFields, yearMonthFromFields, monthDayFromFields
- Add fields() method per Temporal Calendar Protocol
- Extract shared borrow logic from dateUntil() into borrowHijriDiff helper
- Replace magic number 1444 with REFERENCE_YEAR constant
- Convert test suites to node:test runner with describe/it blocks
- Add tests for dateUntil, dateAdd with days/weeks, overflow reject/constrain, fields(), yearMonthFromFields, monthDayFromFields
- Add ESLint + Prettier with typescript-eslint config
- Add lint job to CI workflow
- Add noImplicitReturns and noFallthroughCasesInSwitch to tsconfig
- Disable unused sourcemap generation in tsup
- Update .editorconfig to include .mts and .cts extensions
- Add missing AI agent dirs to .gitignore