use temporal_rs::{Calendar, Duration, TimeZone, ZonedDateTime};
use temporal_rs::options::{RelativeTo, RoundingOptions, Unit};
fn main() {
let d0 = Duration::new(0, 0, 0, 0, 0, 0, 0, 0, 0, 0).unwrap();
let mut rounding_options = RoundingOptions::default();
rounding_options.largest_unit = Some(Unit::Day);
rounding_options.smallest_unit = Some(Unit::Hour);
let relative_to = ZonedDateTime::try_new(0, TimeZone::utc(), Calendar::default()).unwrap();
let rounded_duration = d0.round(rounding_options, Some(RelativeTo::ZonedDateTime(relative_to))).unwrap();
println!("{}", rounded_duration.to_string());
}
prints "-PT24H". It should print "PT0S".
I'll submit a PR shortly.
The following test program:
prints "-PT24H". It should print "PT0S".
I'll submit a PR shortly.