mirror of
https://github.com/acamarata/hijri-core-dart.git
synced 2026-06-30 18:54:27 +00:00
toHijri in both UAQ and FCNA engines read .year/.month/.day from the input DateTime — local calendar components — then passed them to DateTime.utc(). On hosts west of UTC a UTC-midnight local DateTime resolves to the previous local day, causing toHijri(toGregorian(y,m,d)) to return the wrong Hijri day. Fix: call date.toUtc() first in both engines before extracting calendar components. This is symmetric with toGregorian which always returns DateTime.utc(). Adds 3 regression tests covering the round-trip and the local-DateTime-on-UTC-west-host case.
1.4 KiB
1.4 KiB
Changelog
All notable changes to this project will be documented in this file.
The format follows Keep a Changelog. This project adheres to Semantic Versioning.
[Unreleased]
Fixed
toHijrinow normalizes the inputDateTimeto its UTC calendar day before lookup (viadate.toUtc()), matching the UTC-midnight contract oftoGregorian. Previously, passing a localDateTimeon a host west of UTC could return the previous Hijri day, breakingtoHijri(toGregorian(y, m, d))round-trips. Applies to both the UAQ and FCNA engines.
[1.0.0] - 2026-05-25
Added
- Initial public release.
toHijri— converts a GregorianDateTimeto a Hijri date tuple.fromHijri— converts a Hijri date tuple to a GregorianDateTime.daysInMonth— returns the number of days in a given Hijri month for a given engine.isValid— validates a Hijri date for a given engine.listCalendars/getCalendar— registry API for available calendar engines.- Built-in Umm al-Qura (UAQ) engine with tabular data.
- Built-in FCNA (Fiqh Council of North America) calculated engine.
- Pluggable
CalendarEngineabstract class for custom Hijri calendar implementations. - Pure Dart implementation. Zero runtime dependencies.
- Dart SDK
^3.7.0compatibility. - 42 unit tests covering all 8 SPORT features across both UAQ and FCNA engines.