mirror of
https://github.com/acamarata/date-fns-hijri.git
synced 2026-07-03 04:00:38 +00:00
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.
34 lines
1.4 KiB
Markdown
34 lines
1.4 KiB
Markdown
# Changelog
|
|
|
|
All notable changes to this project will be documented in this file.
|
|
|
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
|
|
## [Unreleased]
|
|
|
|
### Fixed
|
|
- `toHijriDate` and all field getters now produce exact round-trips on every host timezone (input Date interpreted by its local calendar day, matching date-fns conventions; previously used raw Date which failed in timezones west of UTC against hijri-core's UTC-day contract).
|
|
|
|
### Changed
|
|
- `fromHijriDate` and all arithmetic/boundary helpers (`addHijriMonths`, `addHijriYears`, `startOfHijriMonth`, `endOfHijriMonth`) now return **local-midnight** Dates instead of UTC midnight / local noon. Use `getFullYear()`/`getMonth()`/`getDate()` (or date-fns `format()`) on the result — not `toISOString()`.
|
|
- Lock-step with unreleased hijri-core `fix/utc-day-boundary` (UTC-day contract).
|
|
|
|
## [1.0.2] - 2026-05-30
|
|
|
|
### Changed
|
|
- Trim README to concise reference format; remove redundant em-dash connectors
|
|
- Add TypeDoc API documentation generation
|
|
|
|
## [1.0.1] - 2026-05-28
|
|
|
|
### Changed
|
|
- Flatten exports map to ADR-015 standard (import/require/types at top level)
|
|
- Add "./package.json" export condition
|
|
- Add coverage script (c8 --reporter=lcov)
|
|
- Migrate CI from pnpm/action-setup to corepack enable
|
|
|
|
## [1.0.0] - 2026-05-28
|
|
|
|
### Added
|
|
- Initial release
|