@@ -14,7 +14,7 @@ use crate::{
14
14
primitive:: FiniteF64 ,
15
15
provider:: TimeZoneProvider ,
16
16
rounding:: { IncrementRounder , Round } ,
17
- TemporalError , TemporalResult , TemporalUnwrap , NS_PER_DAY ,
17
+ Calendar , TemporalError , TemporalResult , TemporalUnwrap , NS_PER_DAY ,
18
18
} ;
19
19
20
20
use super :: { DateDuration , Duration , Sign , TimeDuration } ;
@@ -782,12 +782,14 @@ impl NormalizedDurationRecord {
782
782
//
783
783
// spec(2025-05-28): https://github.com/tc39/proposal-temporal/tree/69001e954c70e29ba3d2e6433bc7ece2a037377a
784
784
#[ inline]
785
+ #[ allow( clippy:: too_many_arguments) ]
785
786
fn bubble_relative_duration (
786
787
& self ,
787
788
sign : Sign ,
788
789
nudged_epoch_ns : i128 ,
789
- date_time : & PlainDateTime ,
790
+ iso_date_time : & IsoDateTime ,
790
791
time_zone : Option < ( & TimeZone , & impl TimeZoneProvider ) > ,
792
+ calendar : & Calendar ,
791
793
largest_unit : Unit ,
792
794
smallest_unit : Unit ,
793
795
) -> TemporalResult < NormalizedDurationRecord > {
@@ -858,14 +860,14 @@ impl NormalizedDurationRecord {
858
860
} ;
859
861
860
862
// iv. Let end be ? CalendarDateAdd(calendar, isoDateTime.[[ISODate]], endDuration, constrain).
861
- let end = date_time . calendar ( ) . date_add (
862
- & date_time . iso . date ,
863
+ let end = calendar. date_add (
864
+ & iso_date_time . date ,
863
865
& Duration :: from ( end_duration) ,
864
866
ArithmeticOverflow :: Constrain ,
865
867
) ?;
866
868
867
869
// v. Let endDateTime be CombineISODateAndTimeRecord(end, isoDateTime.[[Time]]).
868
- let end_date_time = IsoDateTime :: new_unchecked ( end. iso , date_time . iso . time ) ;
870
+ let end_date_time = IsoDateTime :: new_unchecked ( end. iso , iso_date_time . time ) ;
869
871
870
872
let end_epoch_ns = match time_zone {
871
873
// vi. If timeZone is unset, then
@@ -951,8 +953,9 @@ impl NormalizedDurationRecord {
951
953
duration = duration. bubble_relative_duration (
952
954
sign,
953
955
nudge_result. nudge_epoch_ns ,
954
- dt ,
956
+ & dt . iso ,
955
957
timezone_record,
958
+ dt. calendar ( ) ,
956
959
options. largest_unit ,
957
960
start_unit,
958
961
) ?
0 commit comments