Debian Codegraph @

js/src/tests/test262/intl402/Temporal/ZonedDateTime/from/do-not-canonicalize-iana-identifiers.js

raw
1 // |reftest| shell-option(--enable-temporal) skip-if(!this.hasOwnProperty('Temporal')||!xulRuntime.shell) -- Temporal is not enabled unconditionally, requires shell-options
2 // Copyright (C) 2023 Justin Grant. All rights reserved.
3 // This code is governed by the BSD license found in the LICENSE file.
4
5 /*---
6 esid: sec-temporal.zoneddatetime.from
7 description: ZonedDateTime.from does not canonicalize time zone IDs
8 features: [Temporal, canonical-tz]
9 ---*/
10
11 const calcutta = Temporal.ZonedDateTime.from('2020-01-01T00:00:00+05:30[Asia/Calcutta]');
12 const kolkata = Temporal.ZonedDateTime.from('2020-01-01T00:00:00+05:30[Asia/Kolkata]');
13
14 assert.sameValue(calcutta.toString(), '2020-01-01T00:00:00+05:30[Asia/Calcutta]');
15 assert.sameValue(calcutta.toJSON(), '2020-01-01T00:00:00+05:30[Asia/Calcutta]');
16 assert.sameValue(calcutta.timeZoneId, 'Asia/Calcutta');
17
18 assert.sameValue(kolkata.toString(), '2020-01-01T00:00:00+05:30[Asia/Kolkata]');
19 assert.sameValue(kolkata.toJSON(), '2020-01-01T00:00:00+05:30[Asia/Kolkata]');
20 assert.sameValue(kolkata.timeZoneId, 'Asia/Kolkata');
21
22 reportCompare(0, 0);