1 // |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally
2 // Copyright (C) 2022 Igalia, S.L. All rights reserved.
3 // This code is governed by the BSD license found in the LICENSE file.
6 esid: sec-temporal.zoneddatetime.prototype.equals
7 description: UTC offset not valid with format that does not include a time
11 const timeZone = new Temporal.TimeZone("UTC");
12 const instance = new Temporal.ZonedDateTime(0n, timeZone);
14 const validStrings = [
15 "1970-01-01T00Z[UTC]",
16 "1970-01-01T00Z[!UTC]",
17 "1970-01-01T00+00:00[UTC]",
18 "1970-01-01T00+00:00[!UTC]",
21 for (const arg of validStrings) {
22 const result = instance.equals(arg);
27 `"${arg}" is a valid UTC offset with time for ZonedDateTime`
31 const invalidStrings = [
33 "2022-09-15Z[Europe/Vienna]",
34 "2022-09-15+00:00[UTC]",
35 "2022-09-15-02:30[America/St_Johns]",
38 for (const arg of invalidStrings) {
41 () => instance.equals(arg),
42 `"${arg}" UTC offset without time is not valid for ZonedDateTime`