test262/test/built-ins/Temporal/ZonedDateTime/timezone-string-multiple-offsets.js
Philip Chimento a38d3f3b67 Add missing test for Temporal.ZonedDateTime constructor
The test for a TimeZone created from an ISO string with multiple offsets
was missing from the Temporal.ZonedDateTime constructor, whereas it was
present for several other APIs. Add it.
2022-04-21 12:14:10 -07:00

16 lines
721 B
JavaScript

// Copyright (C) 2021 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-temporal.zoneddatetime
description: Time zone strings with UTC offset fractional part are not confused with time fractional part
features: [Temporal]
---*/
const timeZone = "2021-08-19T17:30:45.123456789+01:46[+01:45:30.987654321]";
const result1 = new Temporal.ZonedDateTime(0n, timeZone);
assert.sameValue(result1.timeZone.id, "+01:45:30.987654321", "Time zone string determined from bracket name");
const result2 = new Temporal.ZonedDateTime(0n, { timeZone });
assert.sameValue(result2.timeZone.id, "+01:45:30.987654321", "Time zone string determined from bracket name");