diff options
Diffstat (limited to 'js/src/tests/test262/intl402/DateTimeFormat/prototype/resolvedOptions/offset-timezone-change.js')
-rw-r--r-- | js/src/tests/test262/intl402/DateTimeFormat/prototype/resolvedOptions/offset-timezone-change.js | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/js/src/tests/test262/intl402/DateTimeFormat/prototype/resolvedOptions/offset-timezone-change.js b/js/src/tests/test262/intl402/DateTimeFormat/prototype/resolvedOptions/offset-timezone-change.js new file mode 100644 index 0000000000..714286e287 --- /dev/null +++ b/js/src/tests/test262/intl402/DateTimeFormat/prototype/resolvedOptions/offset-timezone-change.js @@ -0,0 +1,35 @@ +// Copyright 2023 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-createdatetimeformat +description: Tests that offset time zones are correctly normalized in resolvedOptions() output. +---*/ +let validOffsetTimeZones = { + '-00': '+00:00', + '-00:00': '+00:00', + '−00:00': '+00:00', + '+00': '+00:00', + '+0000': '+00:00', + '+0300': '+03:00', + '+03:00': '+03:00', + '+13:00': '+13:00', + '+2300': '+23:00', + '-07:00': '-07:00', + '-14': '-14:00', + '-2100': '-21:00', + '−2200': '-22:00', + '+0103': '+01:03', + '+15:59': '+15:59', + '+2227': '+22:27', + '-02:32': '-02:32', + '-1701': '-17:01', + '-22:23': '-22:23', + '−22:53': '-22:53', +}; +Object.keys(validOffsetTimeZones).forEach((timeZone) => { + let df = new Intl.DateTimeFormat(undefined, {timeZone}); + let expected = validOffsetTimeZones[timeZone]; + assert.sameValue(df.resolvedOptions().timeZone, expected, timeZone); +}); + +reportCompare(0, 0); |