Skip to content

Commit 166654e

Browse files
ptomato12wrigja
authored andcommitted
Fix observable call of ToTemporalTimeZone in ToTemporalZonedDateTime
The reference code was out of line with the spec text here, which says that ToTemporalTimeZone must be called before InterpretTemporalDateTimeFields. Both calls are observable. See also tc39/proposal-temporal#2252 UPSTREAM_COMMIT=a00d9593b807b58c3176570e64ad7b8e0eb4f22b
1 parent 9d68d0c commit 166654e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/ecmascript.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1770,12 +1770,12 @@ export function ToTemporalZonedDateTime(
17701770
] as const);
17711771
const fieldNamesWithTzAndOffset = ArrayPush(fieldNames, 'timeZone', 'offset');
17721772
const fields = PrepareTemporalFields(item, fieldNamesWithTzAndOffset, ['timeZone']);
1773+
timeZone = ToTemporalTimeZone(fields.timeZone);
17731774
({ year, month, day, hour, minute, second, millisecond, microsecond, nanosecond } = InterpretTemporalDateTimeFields(
17741775
calendar,
17751776
fields,
17761777
options
17771778
));
1778-
timeZone = ToTemporalTimeZone(fields.timeZone);
17791779
offset = fields.offset;
17801780
if (offset === undefined) {
17811781
offsetBehaviour = 'wall';

0 commit comments

Comments
 (0)