@@ -5,7 +5,7 @@ use core::{cmp, num::NonZeroU128, ops::Add};
5
5
use num_traits:: AsPrimitive ;
6
6
7
7
use crate :: {
8
- builtins:: core:: { timezone :: TimeZone , PlainDate , PlainDateTime } ,
8
+ builtins:: core:: { time_zone :: TimeZone , PlainDate , PlainDateTime } ,
9
9
iso:: { IsoDate , IsoDateTime } ,
10
10
options:: {
11
11
Disambiguation , Overflow , ResolvedRoundingOptions , RoundingIncrement , RoundingMode , Unit ,
@@ -372,7 +372,7 @@ impl InternalDurationRecord {
372
372
sign : Sign ,
373
373
dest_epoch_ns : i128 ,
374
374
dt : & PlainDateTime ,
375
- tz : Option < ( & TimeZone , & impl TimeZoneProvider ) > , // ???
375
+ time_zone : Option < ( & TimeZone , & impl TimeZoneProvider ) > , // ???
376
376
options : ResolvedRoundingOptions ,
377
377
) -> TemporalResult < NudgeRecord > {
378
378
// NOTE: r2 may never be used...need to test.
@@ -584,13 +584,13 @@ impl InternalDurationRecord {
584
584
let end = IsoDateTime :: new_unchecked ( end. iso , dt. iso . time ) ;
585
585
586
586
// 12. Else,
587
- let ( start_epoch_ns, end_epoch_ns) = if let Some ( ( tz , provider) ) = tz {
587
+ let ( start_epoch_ns, end_epoch_ns) = if let Some ( ( time_zone , provider) ) = time_zone {
588
588
// a. Let startEpochNs be ? GetEpochNanosecondsFor(timeZone, startDateTime, compatible).
589
589
// b. Let endEpochNs be ? GetEpochNanosecondsFor(timeZone, endDateTime, compatible).
590
590
let start_epoch_ns =
591
- tz . get_epoch_nanoseconds_for ( start, Disambiguation :: Compatible , provider) ?;
591
+ time_zone . get_epoch_nanoseconds_for ( start, Disambiguation :: Compatible , provider) ?;
592
592
let end_epoch_ns =
593
- tz . get_epoch_nanoseconds_for ( end, Disambiguation :: Compatible , provider) ?;
593
+ time_zone . get_epoch_nanoseconds_for ( end, Disambiguation :: Compatible , provider) ?;
594
594
( start_epoch_ns. ns , end_epoch_ns. ns )
595
595
// 11. If timeZoneRec is unset, then
596
596
} else {
@@ -658,7 +658,7 @@ impl InternalDurationRecord {
658
658
& self ,
659
659
sign : Sign ,
660
660
dt : & PlainDateTime ,
661
- tz : & TimeZone ,
661
+ time_zone : & TimeZone ,
662
662
options : ResolvedRoundingOptions ,
663
663
provider : & impl TimeZoneProvider ,
664
664
) -> TemporalResult < NudgeRecord > {
@@ -681,9 +681,11 @@ impl InternalDurationRecord {
681
681
// 4. Let endDateTime be CombineISODateAndTimeRecord(endDate, isoDateTime.[[Time]]).
682
682
let end_dt = IsoDateTime :: new_unchecked ( end_date, dt. iso . time ) ;
683
683
// 5. Let startEpochNs be ? GetEpochNanosecondsFor(timeZone, startDateTime, compatible).
684
- let start = tz. get_epoch_nanoseconds_for ( start_dt, Disambiguation :: Compatible , provider) ?;
684
+ let start =
685
+ time_zone. get_epoch_nanoseconds_for ( start_dt, Disambiguation :: Compatible , provider) ?;
685
686
// 6. Let endEpochNs be ? GetEpochNanosecondsFor(timeZone, endDateTime, compatible).
686
- let end = tz. get_epoch_nanoseconds_for ( end_dt, Disambiguation :: Compatible , provider) ?;
687
+ let end =
688
+ time_zone. get_epoch_nanoseconds_for ( end_dt, Disambiguation :: Compatible , provider) ?;
687
689
// 7. Let daySpan be TimeDurationFromEpochNanosecondsDifference(endEpochNs, startEpochNs).
688
690
let day_span = TimeDuration :: from_nanosecond_difference ( end. ns . 0 , start. ns . 0 ) ?;
689
691
// 8. Assert: TimeDurationSign(daySpan) = sign.
@@ -1012,19 +1014,19 @@ impl InternalDurationRecord {
1012
1014
& self ,
1013
1015
dest_epoch_ns : i128 ,
1014
1016
dt : & PlainDateTime ,
1015
- tz : Option < ( & TimeZone , & impl TimeZoneProvider ) > ,
1017
+ time_zone : Option < ( & TimeZone , & impl TimeZoneProvider ) > ,
1016
1018
unit : Unit ,
1017
1019
) -> TemporalResult < FiniteF64 > {
1018
1020
// 1. If IsCalendarUnit(unit) is true, or timeZone is not unset and unit is day, then
1019
- if unit. is_calendar_unit ( ) || ( tz . is_some ( ) && unit == Unit :: Day ) {
1021
+ if unit. is_calendar_unit ( ) || ( time_zone . is_some ( ) && unit == Unit :: Day ) {
1020
1022
// a. Let sign be InternalDurationSign(duration).
1021
1023
let sign = self . sign ( ) ;
1022
1024
// b. Let record be ? NudgeToCalendarUnit(sign, duration, destEpochNs, isoDateTime, timeZone, calendar, 1, unit, trunc).
1023
1025
let record = self . nudge_calendar_unit (
1024
1026
sign,
1025
1027
dest_epoch_ns,
1026
1028
dt,
1027
- tz ,
1029
+ time_zone ,
1028
1030
ResolvedRoundingOptions {
1029
1031
largest_unit : unit,
1030
1032
smallest_unit : unit,
0 commit comments