Open anba opened 2 months ago
day_of_month
can return zero for some dates when using the non-always-calculating constructor. That's probably a related issue:
use icu::calendar::Date;
use icu::calendar::Calendar;
use icu::calendar::islamic::IslamicObservational;
fn main() {
// let cal = IslamicObservational::new_always_calculating();
let cal = IslamicObservational::new();
let iso = Date::try_new_iso_date(2000, 5, 5).unwrap();
let date = cal.date_from_iso(iso);
println!("month = {}", cal.month(&date).ordinal);
println!("day = {}", cal.day_of_month(&date).0);
}
cc @sffc
The following test case doesn't pass when checking converting to an ISO date and back again returns the same month. When switching to
new_always_calculating
the test case does succeed.This is a regression in release 1.5. It still worked correctly in release 1.4.
Test case: