File tree Expand file tree Collapse file tree 2 files changed +6
-13
lines changed Expand file tree Collapse file tree 2 files changed +6
-13
lines changed Original file line number Diff line number Diff line change @@ -162,13 +162,13 @@ function createDateTimeFormat(
162162 SetSlot ( dtf , TZ_ORIGINAL , ro . timeZone ) ;
163163 } else {
164164 const id = ES . ToString ( timeZoneOption ) ;
165- if ( ES . IsOffsetTimeZoneIdentifier ( id ) ) {
166- // Note: https://github.com/tc39/ecma402/issues/683 will remove this
167- throw new RangeError ( 'Intl.DateTimeFormat does not currently support offset time zones' ) ;
165+ if ( id . startsWith ( '−' ) ) {
166+ // The initial (Node 23) implementation of offset time zones allowed use
167+ // of the Unicode minus sign, which was disallowed by a later spec change.
168+ throw new RangeError ( 'Unicode minus (U+2212) is not supported in time zone offsets' ) ;
168169 }
169- const record = ES . GetAvailableNamedTimeZoneIdentifier ( id ) ;
170- if ( ! record ) throw new RangeError ( `Intl.DateTimeFormat formats built-in time zones, not ${ id } ` ) ;
171- SetSlot ( dtf , TZ_ORIGINAL , record . identifier ) ;
170+ // store a normalized identifier
171+ SetSlot ( dtf , TZ_ORIGINAL , ES . ToTemporalTimeZoneIdentifier ( id ) ) ;
172172 }
173173 return undefined ; // TODO: I couldn't satisfy TS without adding this. Is there another way?
174174}
Original file line number Diff line number Diff line change 66# canonicalizing the timezone name.
77staging/Intl402/Temporal/old/date-time-format.js
88
9- # These are caught by the default test glob, but are unrelated to Temporal.
10- # They rely on Intl.DateTimeFormat supporting offset time zones.
11- intl402/DateTimeFormat/prototype/format/offset-timezone-gmt-same.js
12- intl402/DateTimeFormat/prototype/formatToParts/offset-timezone-correct.js
13- intl402/DateTimeFormat/prototype/resolvedOptions/offset-timezone-basic.js
14- intl402/DateTimeFormat/prototype/resolvedOptions/offset-timezone-change.js
15-
169# https://github.com/tc39/test262/pull/4336
1710intl402/DateTimeFormat/canonicalize-utc-timezone.js
1811
You can’t perform that action at this time.
0 commit comments