Commit graph

8 commits

Author SHA1 Message Date
Aric Camarata
d12117f000 fix: local-day adapter semantics with exact round-trips on hijri-core's UTC-day contract
Behavior changes (lock-step with hijri-core fix/utc-day-boundary):

- toHijriDate and all field/format/comparison/arithmetic functions now lift input
  Dates through localDayToUtcSlot() before calling coreToHijri(), reading the
  caller's LOCAL calendar day (date-fns convention). Previously passed the raw
  Date which caused off-by-one results in timezones west of UTC against the new
  UTC-day core contract.

- fromHijriDate now returns local-midnight Dates (new Date(y, m, d)) instead of
  UTC midnight. Local field accessors and date-fns format() render the intended
  calendar day on every host timezone. toISOString() is no longer the right API
  for this value.

- addHijriMonths, addHijriYears, startOfHijriMonth, endOfHijriMonth call
  fromHijriDate directly; the utcMidnightToLocalNoon shim is removed.

- Round-trip toHijriDate(fromHijriDate(y, m, d)) is now exact on every timezone.

Verified: 58/58 ESM tests, 10/10 CJS tests, 16/16 vitest assertions across
TZ=UTC, TZ=America/New_York, and TZ=Pacific/Auckland.
2026-06-10 16:38:32 -04:00
Aric Camarata
0e0e9e2021 docs: replace em-dash connectors per writing standard 2026-05-30 18:49:07 -04:00
Aric Camarata
fe9c2c932c docs: update TypeDoc sidebar and CI coverage job (pending from prior wave) 2026-05-30 18:32:26 -04:00
Aric Camarata
bc32214cee style: replace em dashes with colons in docs 2026-03-08 17:28:04 -04:00
Aric Camarata
fb861e38de docs: add Architecture section; rename Related Packages heading to Related 2026-03-08 17:10:36 -04:00
Aric Camarata
9eb0459606 docs: add Compatibility and Acknowledgments sections to README 2026-03-08 16:46:30 -04:00
Aric Camarata
536f1c5189 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.
2026-02-25 15:14:11 -05:00
Aric Camarata
d8c5398fdf feat: initial release of date-fns-hijri v1.0.0
Functional Hijri date utility library in date-fns style. 17 exported
functions: toHijriDate, fromHijriDate, isValidHijriDate, getHijriYear,
getHijriMonth, getHijriDay, getDaysInHijriMonth, getHijriMonthName,
getHijriWeekdayName, formatHijriDate, addHijriMonths, addHijriYears,
startOfHijriMonth, endOfHijriMonth, isSameHijriMonth, isSameHijriYear,
getHijriQuarter. All delegate to hijri-core. UTC-midnight-to-local-noon
correction applied in arithmetic functions to avoid timezone boundary
drift. 55 ESM + 10 CJS tests passing. Dual CJS/ESM build.
2026-02-25 14:15:24 -05:00