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. |
||
|---|---|---|
| .. | ||
| hijri_core_test.dart | ||