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(
162
162
SetSlot ( dtf , TZ_ORIGINAL , ro . timeZone ) ;
163
163
} else {
164
164
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' ) ;
168
169
}
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 ) ) ;
172
172
}
173
173
return undefined ; // TODO: I couldn't satisfy TS without adding this. Is there another way?
174
174
}
Original file line number Diff line number Diff line change 6
6
# canonicalizing the timezone name.
7
7
staging/Intl402/Temporal/old/date-time-format.js
8
8
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
-
16
9
# https://github.com/tc39/test262/pull/4336
17
10
intl402/DateTimeFormat/canonicalize-utc-timezone.js
18
11
You can’t perform that action at this time.
0 commit comments