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 42267cf280f..9fd783671e7 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 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 60a6cf19837..2ea1e0bd29a 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 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 774bb727cf6..b0fd12c6df3 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 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 1f85b2dcf6e..09fc0e39fae 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 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 3d4b8f6c6a2..31358b8641b 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 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 b1d948e4d4e..58c2d6a7237 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 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 db6dcd0569a..9415f2212cf 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 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 c5cb987c462..4dd271d63f1 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 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 0e8d22bd9aa..4fa98798c0c 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 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 d7cd7915dd6..42d7f41ee50 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 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 3980f4a66fa..a95ffa3f0fe 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 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 50be32b2ce9..2dcd17aedd5 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 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 425ddbd92c6..a58a1df521c 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 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 1067afa632d..828adcaf43f 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 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 fbba3f71b87..0b314c55611 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 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 c85fd3da5e1..6efe5c47f82 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 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 5ae2b549faf..d098934e394 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 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 a475b9870d3..44b84eab0d7 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 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 b37e7a47e5c..86c4d85866f 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 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/from/argument-propertybag-timezone-string-datetime.js b/test/built-ins/Temporal/ZonedDateTime/from/argument-propertybag-timezone-string-datetime.js index 17413487511..1abafaecaa1 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 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 cafe95f5d44..0b1c38b5095 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 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 ad74231922e..8f18a4cd830 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 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 6e1a291043b..88d8da845c8 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 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 abf963a8ef5..bfb920184ce 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 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 fc7b2665929..0df29f0ad14 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 not OK as time zone"); + // The following are all valid strings so should not throw: [