diff --git a/test/built-ins/Temporal/Duration/compare/relativeto-propertybag-timezone-string-datetime.js b/test/built-ins/Temporal/Duration/compare/relativeto-propertybag-timezone-string-datetime.js index 42267cf280..0266336f2b 100644 --- a/test/built-ins/Temporal/Duration/compare/relativeto-propertybag-timezone-string-datetime.js +++ b/test/built-ins/Temporal/Duration/compare/relativeto-propertybag-timezone-string-datetime.js @@ -10,6 +10,9 @@ features: [Temporal] let timeZone = "2021-08-19T17:30"; assert.throws(RangeError, () => Temporal.Duration.compare(new Temporal.Duration(), new Temporal.Duration(), { relativeTo: { year: 2000, month: 5, day: 2, timeZone } }), "bare date-time string is not a time zone"); +timeZone = "2021-08-19T17:30-07:00:01"; +assert.throws(RangeError, () => Temporal.Duration.compare(new Temporal.Duration(), new Temporal.Duration(), { relativeTo: { year: 2000, month: 5, day: 2, timeZone } }), "ISO string sub-minute offset is not OK as time zone"); + // The following are all valid strings so should not throw: [ diff --git a/test/built-ins/Temporal/Duration/prototype/add/relativeto-propertybag-timezone-string-datetime.js b/test/built-ins/Temporal/Duration/prototype/add/relativeto-propertybag-timezone-string-datetime.js index 60a6cf1983..8967f111e0 100644 --- a/test/built-ins/Temporal/Duration/prototype/add/relativeto-propertybag-timezone-string-datetime.js +++ b/test/built-ins/Temporal/Duration/prototype/add/relativeto-propertybag-timezone-string-datetime.js @@ -12,6 +12,9 @@ const instance = new Temporal.Duration(1); let timeZone = "2021-08-19T17:30"; assert.throws(RangeError, () => instance.add(new Temporal.Duration(1), { relativeTo: { year: 2000, month: 5, day: 2, timeZone } }), "bare date-time string is not a time zone"); +timeZone = "2021-08-19T17:30-07:00:01"; +assert.throws(RangeError, () => instance.add(new Temporal.Duration(1), { relativeTo: { year: 2000, month: 5, day: 2, timeZone } }), "ISO string sub-minute offset is not OK as time zone"); + // The following are all valid strings so should not throw: [ diff --git a/test/built-ins/Temporal/Duration/prototype/round/relativeto-propertybag-timezone-string-datetime.js b/test/built-ins/Temporal/Duration/prototype/round/relativeto-propertybag-timezone-string-datetime.js index 774bb727cf..a432febdf1 100644 --- a/test/built-ins/Temporal/Duration/prototype/round/relativeto-propertybag-timezone-string-datetime.js +++ b/test/built-ins/Temporal/Duration/prototype/round/relativeto-propertybag-timezone-string-datetime.js @@ -12,6 +12,9 @@ const instance = new Temporal.Duration(1); let timeZone = "2021-08-19T17:30"; assert.throws(RangeError, () => instance.round({ largestUnit: "months", relativeTo: { year: 2000, month: 5, day: 2, timeZone } }), "bare date-time string is not a time zone"); +timeZone = "2021-08-19T17:30-07:00:01"; +assert.throws(RangeError, () => instance.round({ largestUnit: "months", relativeTo: { year: 2000, month: 5, day: 2, timeZone } }), "ISO string sub-minute offset is not OK as time zone"); + // The following are all valid strings so should not throw: [ diff --git a/test/built-ins/Temporal/Duration/prototype/subtract/relativeto-propertybag-timezone-string-datetime.js b/test/built-ins/Temporal/Duration/prototype/subtract/relativeto-propertybag-timezone-string-datetime.js index 1f85b2dcf6..6eacab939e 100644 --- a/test/built-ins/Temporal/Duration/prototype/subtract/relativeto-propertybag-timezone-string-datetime.js +++ b/test/built-ins/Temporal/Duration/prototype/subtract/relativeto-propertybag-timezone-string-datetime.js @@ -12,6 +12,9 @@ const instance = new Temporal.Duration(1); let timeZone = "2021-08-19T17:30"; assert.throws(RangeError, () => instance.subtract(new Temporal.Duration(1), { relativeTo: { year: 2000, month: 5, day: 2, timeZone } }), "bare date-time string is not a time zone"); +timeZone = "2021-08-19T17:30-07:00:01"; +assert.throws(RangeError, () => instance.subtract(new Temporal.Duration(1), { relativeTo: { year: 2000, month: 5, day: 2, timeZone } }), "ISO string sub-minute offset is not OK as time zone"); + // The following are all valid strings so should not throw: [ diff --git a/test/built-ins/Temporal/Duration/prototype/total/relativeto-propertybag-timezone-string-datetime.js b/test/built-ins/Temporal/Duration/prototype/total/relativeto-propertybag-timezone-string-datetime.js index 3d4b8f6c6a..97ce80f642 100644 --- a/test/built-ins/Temporal/Duration/prototype/total/relativeto-propertybag-timezone-string-datetime.js +++ b/test/built-ins/Temporal/Duration/prototype/total/relativeto-propertybag-timezone-string-datetime.js @@ -12,6 +12,9 @@ const instance = new Temporal.Duration(1); let timeZone = "2021-08-19T17:30"; assert.throws(RangeError, () => instance.total({ unit: "months", relativeTo: { year: 2000, month: 5, day: 2, timeZone } }), "bare date-time string is not a time zone"); +timeZone = "2021-08-19T17:30-07:00:01"; +assert.throws(RangeError, () => instance.total({ unit: "months", relativeTo: { year: 2000, month: 5, day: 2, timeZone } }), "ISO string sub-minute offset is not OK as time zone"); + // The following are all valid strings so should not throw: [ diff --git a/test/built-ins/Temporal/Instant/prototype/toString/timezone-string-datetime.js b/test/built-ins/Temporal/Instant/prototype/toString/timezone-string-datetime.js index b1d948e4d4..2a8172a3e3 100644 --- a/test/built-ins/Temporal/Instant/prototype/toString/timezone-string-datetime.js +++ b/test/built-ins/Temporal/Instant/prototype/toString/timezone-string-datetime.js @@ -12,6 +12,9 @@ const instance = new Temporal.Instant(0n); let timeZone = "2021-08-19T17:30"; assert.throws(RangeError, () => instance.toString({ timeZone }), "bare date-time string is not a time zone"); +timeZone = "2021-08-19T17:30-07:00:01"; +assert.throws(RangeError, () => instance.toString({ timeZone }), "ISO string sub-minute offset is not OK as time zone"); + timeZone = "2021-08-19T17:30Z"; const result1 = instance.toString({ timeZone }); assert.sameValue(result1.substr(-6), "+00:00", "date-time + Z is UTC time zone"); diff --git a/test/built-ins/Temporal/Instant/prototype/toZonedDateTime/timezone-string-datetime.js b/test/built-ins/Temporal/Instant/prototype/toZonedDateTime/timezone-string-datetime.js index db6dcd0569..3737ba16f1 100644 --- a/test/built-ins/Temporal/Instant/prototype/toZonedDateTime/timezone-string-datetime.js +++ b/test/built-ins/Temporal/Instant/prototype/toZonedDateTime/timezone-string-datetime.js @@ -12,6 +12,9 @@ const instance = new Temporal.Instant(0n); let timeZone = "2021-08-19T17:30"; assert.throws(RangeError, () => instance.toZonedDateTime({ timeZone, calendar: "iso8601" }), "bare date-time string is not a time zone"); +timeZone = "2021-08-19T17:30-07:00:01"; +assert.throws(RangeError, () => instance.toZonedDateTime({ timeZone, calendar: "iso8601" }), "ISO string sub-minute offset is not OK as time zone"); + timeZone = "2021-08-19T17:30Z"; const result1 = instance.toZonedDateTime({ timeZone, calendar: "iso8601" }); assert.sameValue(result1.timeZoneId, "UTC", "date-time + Z is UTC time zone"); diff --git a/test/built-ins/Temporal/Instant/prototype/toZonedDateTimeISO/timezone-string-datetime.js b/test/built-ins/Temporal/Instant/prototype/toZonedDateTimeISO/timezone-string-datetime.js index c5cb987c46..cace9df1e6 100644 --- a/test/built-ins/Temporal/Instant/prototype/toZonedDateTimeISO/timezone-string-datetime.js +++ b/test/built-ins/Temporal/Instant/prototype/toZonedDateTimeISO/timezone-string-datetime.js @@ -12,6 +12,9 @@ const instance = new Temporal.Instant(0n); let timeZone = "2021-08-19T17:30"; assert.throws(RangeError, () => instance.toZonedDateTimeISO(timeZone), "bare date-time string is not a time zone"); +timeZone = "2021-08-19T17:30-07:00:01"; +assert.throws(RangeError, () => instance.toZonedDateTimeISO(timeZone), "ISO string sub-minute offset is not OK as time zone"); + timeZone = "2021-08-19T17:30Z"; const result1 = instance.toZonedDateTimeISO(timeZone); assert.sameValue(result1.timeZoneId, "UTC", "date-time + Z is UTC time zone"); diff --git a/test/built-ins/Temporal/Now/plainDate/timezone-string-datetime.js b/test/built-ins/Temporal/Now/plainDate/timezone-string-datetime.js index 0e8d22bd9a..d0233b8572 100644 --- a/test/built-ins/Temporal/Now/plainDate/timezone-string-datetime.js +++ b/test/built-ins/Temporal/Now/plainDate/timezone-string-datetime.js @@ -10,6 +10,9 @@ features: [Temporal] let timeZone = "2021-08-19T17:30"; assert.throws(RangeError, () => Temporal.Now.plainDate("iso8601", timeZone), "bare date-time string is not a time zone"); +timeZone = "2021-08-19T17:30-07:00:01"; +assert.throws(RangeError, () => Temporal.Now.plainDate("iso8601", timeZone), "ISO string sub-minute offset is not OK as time zone"); + // The following are all valid strings so should not throw: [ diff --git a/test/built-ins/Temporal/Now/plainDateISO/timezone-string-datetime.js b/test/built-ins/Temporal/Now/plainDateISO/timezone-string-datetime.js index d7cd7915dd..332e59aa2a 100644 --- a/test/built-ins/Temporal/Now/plainDateISO/timezone-string-datetime.js +++ b/test/built-ins/Temporal/Now/plainDateISO/timezone-string-datetime.js @@ -10,6 +10,9 @@ features: [Temporal] let timeZone = "2021-08-19T17:30"; assert.throws(RangeError, () => Temporal.Now.plainDateISO(timeZone), "bare date-time string is not a time zone"); +timeZone = "2021-08-19T17:30-07:00:01"; +assert.throws(RangeError, () => Temporal.Now.plainDateISO(timeZone), "ISO string sub-minute offset is not OK as time zone"); + // The following are all valid strings so should not throw: [ diff --git a/test/built-ins/Temporal/Now/plainDateTime/timezone-string-datetime.js b/test/built-ins/Temporal/Now/plainDateTime/timezone-string-datetime.js index 3980f4a66f..efa0f907ad 100644 --- a/test/built-ins/Temporal/Now/plainDateTime/timezone-string-datetime.js +++ b/test/built-ins/Temporal/Now/plainDateTime/timezone-string-datetime.js @@ -10,6 +10,9 @@ features: [Temporal] let timeZone = "2021-08-19T17:30"; assert.throws(RangeError, () => Temporal.Now.plainDateTime("iso8601", timeZone), "bare date-time string is not a time zone"); +timeZone = "2021-08-19T17:30-07:00:01"; +assert.throws(RangeError, () => Temporal.Now.plainDateTime("iso8601", timeZone), "ISO string sub-minute offset is not OK as time zone"); + // The following are all valid strings so should not throw: [ diff --git a/test/built-ins/Temporal/Now/plainDateTimeISO/timezone-string-datetime.js b/test/built-ins/Temporal/Now/plainDateTimeISO/timezone-string-datetime.js index 50be32b2ce..8cacd0a189 100644 --- a/test/built-ins/Temporal/Now/plainDateTimeISO/timezone-string-datetime.js +++ b/test/built-ins/Temporal/Now/plainDateTimeISO/timezone-string-datetime.js @@ -10,6 +10,9 @@ features: [Temporal] let timeZone = "2021-08-19T17:30"; assert.throws(RangeError, () => Temporal.Now.plainDateTimeISO(timeZone), "bare date-time string is not a time zone"); +timeZone = "2021-08-19T17:30-07:00:01"; +assert.throws(RangeError, () => Temporal.Now.plainDateTimeISO(timeZone), "ISO string sub-minute offset is not OK as time zone"); + // The following are all valid strings so should not throw: [ diff --git a/test/built-ins/Temporal/Now/plainTimeISO/timezone-string-datetime.js b/test/built-ins/Temporal/Now/plainTimeISO/timezone-string-datetime.js index 425ddbd92c..6a9790c58b 100644 --- a/test/built-ins/Temporal/Now/plainTimeISO/timezone-string-datetime.js +++ b/test/built-ins/Temporal/Now/plainTimeISO/timezone-string-datetime.js @@ -10,6 +10,9 @@ features: [Temporal] let timeZone = "2021-08-19T17:30"; assert.throws(RangeError, () => Temporal.Now.plainTimeISO(timeZone), "bare date-time string is not a time zone"); +timeZone = "2021-08-19T17:30-07:00:01"; +assert.throws(RangeError, () => Temporal.Now.plainTimeISO(timeZone), "ISO string sub-minute offset is not OK as time zone"); + // The following are all valid strings so should not throw: [ diff --git a/test/built-ins/Temporal/Now/zonedDateTime/timezone-string-datetime.js b/test/built-ins/Temporal/Now/zonedDateTime/timezone-string-datetime.js index 1067afa632..c313a62b7a 100644 --- a/test/built-ins/Temporal/Now/zonedDateTime/timezone-string-datetime.js +++ b/test/built-ins/Temporal/Now/zonedDateTime/timezone-string-datetime.js @@ -10,6 +10,9 @@ features: [Temporal] let timeZone = "2021-08-19T17:30"; assert.throws(RangeError, () => Temporal.Now.zonedDateTime("iso8601", timeZone), "bare date-time string is not a time zone"); +timeZone = "2021-08-19T17:30-07:00:01"; +assert.throws(RangeError, () => Temporal.Now.zonedDateTime("iso8601", timeZone), "ISO string sub-minute offset is not OK as time zone"); + timeZone = "2021-08-19T17:30Z"; const result1 = Temporal.Now.zonedDateTime("iso8601", timeZone); assert.sameValue(result1.timeZoneId, "UTC", "date-time + Z is UTC time zone"); diff --git a/test/built-ins/Temporal/Now/zonedDateTimeISO/timezone-string-datetime.js b/test/built-ins/Temporal/Now/zonedDateTimeISO/timezone-string-datetime.js index fbba3f71b8..f3074339e1 100644 --- a/test/built-ins/Temporal/Now/zonedDateTimeISO/timezone-string-datetime.js +++ b/test/built-ins/Temporal/Now/zonedDateTimeISO/timezone-string-datetime.js @@ -10,6 +10,9 @@ features: [Temporal] let timeZone = "2021-08-19T17:30"; assert.throws(RangeError, () => Temporal.Now.zonedDateTimeISO(timeZone), "bare date-time string is not a time zone"); +timeZone = "2021-08-19T17:30-07:00:01"; +assert.throws(RangeError, () => Temporal.Now.zonedDateTimeISO(timeZone), "ISO string sub-minute offset is not OK as time zone"); + timeZone = "2021-08-19T17:30Z"; const result1 = Temporal.Now.zonedDateTimeISO(timeZone); assert.sameValue(result1.timeZoneId, "UTC", "date-time + Z is UTC time zone"); diff --git a/test/built-ins/Temporal/PlainDate/prototype/toZonedDateTime/timezone-string-datetime.js b/test/built-ins/Temporal/PlainDate/prototype/toZonedDateTime/timezone-string-datetime.js index c85fd3da5e..d809691877 100644 --- a/test/built-ins/Temporal/PlainDate/prototype/toZonedDateTime/timezone-string-datetime.js +++ b/test/built-ins/Temporal/PlainDate/prototype/toZonedDateTime/timezone-string-datetime.js @@ -12,6 +12,9 @@ const instance = new Temporal.PlainDate(2000, 5, 2); let timeZone = "2021-08-19T17:30"; assert.throws(RangeError, () => instance.toZonedDateTime(timeZone), "bare date-time string is not a time zone"); +timeZone = "2021-08-19T17:30-07:00:01"; +assert.throws(RangeError, () => instance.toZonedDateTime(timeZone), "ISO string sub-minute offset is not OK as time zone"); + timeZone = "2021-08-19T17:30Z"; const result1 = instance.toZonedDateTime(timeZone); assert.sameValue(result1.timeZoneId, "UTC", "date-time + Z is UTC time zone"); diff --git a/test/built-ins/Temporal/PlainDateTime/prototype/toZonedDateTime/timezone-string-datetime.js b/test/built-ins/Temporal/PlainDateTime/prototype/toZonedDateTime/timezone-string-datetime.js index 5ae2b549fa..2ed43505f2 100644 --- a/test/built-ins/Temporal/PlainDateTime/prototype/toZonedDateTime/timezone-string-datetime.js +++ b/test/built-ins/Temporal/PlainDateTime/prototype/toZonedDateTime/timezone-string-datetime.js @@ -12,6 +12,9 @@ const instance = new Temporal.PlainDateTime(2000, 5, 2); let timeZone = "2021-08-19T17:30"; assert.throws(RangeError, () => instance.toZonedDateTime(timeZone), "bare date-time string is not a time zone"); +timeZone = "2021-08-19T17:30-07:00:01"; +assert.throws(RangeError, () => instance.toZonedDateTime(timeZone), "ISO string sub-minute offset is not OK as time zone"); + timeZone = "2021-08-19T17:30Z"; const result1 = instance.toZonedDateTime(timeZone); assert.sameValue(result1.timeZoneId, "UTC", "date-time + Z is UTC time zone"); diff --git a/test/built-ins/Temporal/PlainTime/prototype/toZonedDateTime/timezone-string-datetime.js b/test/built-ins/Temporal/PlainTime/prototype/toZonedDateTime/timezone-string-datetime.js index a475b9870d..cde37b6834 100644 --- a/test/built-ins/Temporal/PlainTime/prototype/toZonedDateTime/timezone-string-datetime.js +++ b/test/built-ins/Temporal/PlainTime/prototype/toZonedDateTime/timezone-string-datetime.js @@ -12,6 +12,9 @@ const instance = new Temporal.PlainTime(); let timeZone = "2021-08-19T17:30"; assert.throws(RangeError, () => instance.toZonedDateTime({ plainDate: new Temporal.PlainDate(2000, 5, 2), timeZone }), "bare date-time string is not a time zone"); +timeZone = "2021-08-19T17:30-07:00:01"; +assert.throws(RangeError, () => instance.toZonedDateTime({ plainDate: new Temporal.PlainDate(2000, 5, 2), timeZone }), "ISO string sub-minute offset is not OK as time zone"); + timeZone = "2021-08-19T17:30Z"; const result1 = instance.toZonedDateTime({ plainDate: new Temporal.PlainDate(2000, 5, 2), timeZone }); assert.sameValue(result1.timeZoneId, "UTC", "date-time + Z is UTC time zone"); diff --git a/test/built-ins/Temporal/TimeZone/from/timezone-string-datetime.js b/test/built-ins/Temporal/TimeZone/from/timezone-string-datetime.js index b37e7a47e5..7d3cb9523e 100644 --- a/test/built-ins/Temporal/TimeZone/from/timezone-string-datetime.js +++ b/test/built-ins/Temporal/TimeZone/from/timezone-string-datetime.js @@ -10,6 +10,9 @@ features: [Temporal] let timeZone = "2021-08-19T17:30"; assert.throws(RangeError, () => Temporal.TimeZone.from(timeZone), "bare date-time string is not a time zone"); +timeZone = "2021-08-19T17:30-07:00:01"; +assert.throws(RangeError, () => Temporal.TimeZone.from(timeZone), "ISO string sub-minute offset is not OK as time zone"); + timeZone = "2021-08-19T17:30Z"; const result1 = Temporal.TimeZone.from(timeZone); assert.sameValue(result1.id, "UTC", "date-time + Z is UTC time zone"); diff --git a/test/built-ins/Temporal/ZonedDateTime/compare/argument-propertybag-timezone-string-datetime.js b/test/built-ins/Temporal/ZonedDateTime/compare/argument-propertybag-timezone-string-datetime.js index 27db89caec..e6356e5146 100644 --- a/test/built-ins/Temporal/ZonedDateTime/compare/argument-propertybag-timezone-string-datetime.js +++ b/test/built-ins/Temporal/ZonedDateTime/compare/argument-propertybag-timezone-string-datetime.js @@ -13,6 +13,10 @@ let timeZone = "2021-08-19T17:30"; assert.throws(RangeError, () => Temporal.ZonedDateTime.compare({ year: 2000, month: 5, day: 2, timeZone }, instance), "bare date-time string is not a time zone (arg 1)"); assert.throws(RangeError, () => Temporal.ZonedDateTime.compare(instance, { year: 2000, month: 5, day: 2, timeZone }), "bare date-time string is not a time zone (arg 2)"); +timeZone = "2021-08-19T17:30-07:00:01"; +assert.throws(RangeError, () => Temporal.ZonedDateTime.compare({ year: 2000, month: 5, day: 2, timeZone }, instance), "ISO string sub-minute offset is not OK as time zone (arg 1)"); +assert.throws(RangeError, () => Temporal.ZonedDateTime.compare(instance, { year: 2000, month: 5, day: 2, timeZone }), "ISO string sub-minute offset is not OK as time zone (arg 2)"); + // The following are all valid strings so should not throw: [ diff --git a/test/built-ins/Temporal/ZonedDateTime/from/argument-propertybag-timezone-string-datetime.js b/test/built-ins/Temporal/ZonedDateTime/from/argument-propertybag-timezone-string-datetime.js index 1741348751..b7a531bd21 100644 --- a/test/built-ins/Temporal/ZonedDateTime/from/argument-propertybag-timezone-string-datetime.js +++ b/test/built-ins/Temporal/ZonedDateTime/from/argument-propertybag-timezone-string-datetime.js @@ -10,6 +10,9 @@ features: [Temporal] let timeZone = "2021-08-19T17:30"; assert.throws(RangeError, () => Temporal.ZonedDateTime.from({ year: 2000, month: 5, day: 2, timeZone }), "bare date-time string is not a time zone"); +timeZone = "2021-08-19T17:30-07:00:01"; +assert.throws(RangeError, () => Temporal.ZonedDateTime.from({ year: 2000, month: 5, day: 2, timeZone }), "ISO string sub-minute offset is not OK as time zone"); + timeZone = "2021-08-19T17:30Z"; const result1 = Temporal.ZonedDateTime.from({ year: 2000, month: 5, day: 2, timeZone }); assert.sameValue(result1.timeZoneId, "UTC", "date-time + Z is UTC time zone"); diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/since/argument-propertybag-timezone-string-datetime.js b/test/built-ins/Temporal/ZonedDateTime/prototype/since/argument-propertybag-timezone-string-datetime.js index cafe95f5d4..d08bbf58fb 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/since/argument-propertybag-timezone-string-datetime.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/since/argument-propertybag-timezone-string-datetime.js @@ -13,6 +13,9 @@ const instance1 = new Temporal.ZonedDateTime(0n, expectedTimeZone); let timeZone = "2021-08-19T17:30"; assert.throws(RangeError, () => instance1.since({ year: 2020, month: 5, day: 2, timeZone }), "bare date-time string is not a time zone"); +timeZone = "2021-08-19T17:30-07:00:01"; +assert.throws(RangeError, () => instance1.since({ year: 2020, month: 5, day: 2, timeZone }), "ISO string sub-minute offset is not OK as time zone"); + // The following are all valid strings so should not throw. They should produce // expectedTimeZone, so additionally the operation will not throw due to the // time zones being different on the receiver and the argument. diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/until/argument-propertybag-timezone-string-datetime.js b/test/built-ins/Temporal/ZonedDateTime/prototype/until/argument-propertybag-timezone-string-datetime.js index ad74231922..6f4929da19 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/until/argument-propertybag-timezone-string-datetime.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/until/argument-propertybag-timezone-string-datetime.js @@ -13,6 +13,9 @@ const instance1 = new Temporal.ZonedDateTime(0n, expectedTimeZone); let timeZone = "2021-08-19T17:30"; assert.throws(RangeError, () => instance1.until({ year: 2020, month: 5, day: 2, timeZone }), "bare date-time string is not a time zone"); +timeZone = "2021-08-19T17:30-07:00:01"; +assert.throws(RangeError, () => instance1.until({ year: 2020, month: 5, day: 2, timeZone }), "ISO string sub-minute offset is not OK as time zone"); + // The following are all valid strings so should not throw. They should produce // expectedTimeZone, so additionally the operation will not throw due to the // time zones being different on the receiver and the argument. diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/withTimeZone/timezone-string-datetime.js b/test/built-ins/Temporal/ZonedDateTime/prototype/withTimeZone/timezone-string-datetime.js index 6e1a291043..3378f89bcf 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/withTimeZone/timezone-string-datetime.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/withTimeZone/timezone-string-datetime.js @@ -12,6 +12,9 @@ const instance = new Temporal.ZonedDateTime(0n, "UTC"); let timeZone = "2021-08-19T17:30"; assert.throws(RangeError, () => instance.withTimeZone(timeZone), "bare date-time string is not a time zone"); +timeZone = "2021-08-19T17:30-07:00:01"; +assert.throws(RangeError, () => instance.withTimeZone(timeZone), "ISO string sub-minute offset is not OK as time zone"); + timeZone = "2021-08-19T17:30Z"; const result1 = instance.withTimeZone(timeZone); assert.sameValue(result1.timeZoneId, "UTC", "date-time + Z is UTC time zone"); diff --git a/test/built-ins/Temporal/ZonedDateTime/timezone-string-datetime.js b/test/built-ins/Temporal/ZonedDateTime/timezone-string-datetime.js index abf963a8ef..243d6dc380 100644 --- a/test/built-ins/Temporal/ZonedDateTime/timezone-string-datetime.js +++ b/test/built-ins/Temporal/ZonedDateTime/timezone-string-datetime.js @@ -10,6 +10,9 @@ features: [Temporal] let timeZone = "2021-08-19T17:30"; assert.throws(RangeError, () => new Temporal.ZonedDateTime(0n, timeZone), "bare date-time string is not a time zone"); +timeZone = "2021-08-19T17:30-07:00:01"; +assert.throws(RangeError, () => new Temporal.ZonedDateTime(0n, timeZone), "ISO string sub-minute offset is not OK as time zone"); + timeZone = "2021-08-19T17:30Z"; const result1 = new Temporal.ZonedDateTime(0n, timeZone); assert.sameValue(result1.timeZoneId, "UTC", "date-time + Z is UTC time zone"); diff --git a/test/intl402/Temporal/Now/plainDateTimeISO/timezone-string-datetime.js b/test/intl402/Temporal/Now/plainDateTimeISO/timezone-string-datetime.js index fc7b266592..fe2dd69e42 100644 --- a/test/intl402/Temporal/Now/plainDateTimeISO/timezone-string-datetime.js +++ b/test/intl402/Temporal/Now/plainDateTimeISO/timezone-string-datetime.js @@ -9,6 +9,9 @@ features: [Temporal] let timeZone = "2021-08-19T17:30"; assert.throws(RangeError, () => Temporal.Now.plainDateTimeISO(timeZone), "bare date-time string is not a time zone"); +timeZone = "2021-08-19T17:30-07:00:01"; +assert.throws(RangeError, () => Temporal.Now.plainDateTimeISO(timeZone), "ISO string sub-minute offset is not OK as time zone"); + // The following are all valid strings so should not throw: [