You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// c. Let calendar be plainRelativeTo.[[Calendar]].
758
-
let calendar = plain_relative_to.calendar().clone();
771
+
let calendar = plain_relative_to.calendar();
759
772
760
773
// d. Let dateDuration be ! AdjustDateDurationRecord(internalDuration.[[Date]], targetTime.[[Days]]).
761
-
let date_duration = self.date.adjust(target_time_days,None,None)?;
774
+
let date_duration =
775
+
internal_duration
776
+
.date()
777
+
.adjust(target_time_days,None,None)?;
762
778
763
779
// e. Let targetDate be ? CalendarDateAdd(calendar, plainRelativeTo.[[ISODate]], dateDuration, constrain).
764
-
let target_date = calendar.date_add(
765
-
&plain_relative_to.iso,
780
+
let target_date = plain_relative_to.add_date(
766
781
&Duration::from(date_duration),
767
-
ArithmeticOverflow::Constrain,
782
+
Some(ArithmeticOverflow::Constrain),
768
783
)?;
784
+
// let target_date = calendar.date_add(
785
+
// &plain_relative_to.iso,
786
+
// &Duration::from(date_duration),
787
+
// ArithmeticOverflow::Constrain,
788
+
// )?;
769
789
770
790
// f. Let isoDateTime be CombineISODateAndTimeRecord(plainRelativeTo.[[ISODate]], MidnightTimeRecord()).
771
791
let iso_date_time =
@@ -775,11 +795,12 @@ impl Duration {
775
795
let target_date_time = IsoDateTime::new_unchecked(target_date.iso, target_time.iso);
776
796
777
797
// h. Set internalDuration to ? DifferencePlainDateTimeWithRounding(isoDateTime, targetDateTime, calendar, largestUnit, roundingIncrement, smallestUnit, roundingMode).
0 commit comments