Move IANA TimeZone tests to intl402

IANA TimeZone name other than "UTC" is only required if the implementation " includes the ECMA-402 Internationalization API"
https://tc39.es/proposal-temporal/#sec-isvalidtimezonename
Therefore, we need to split the test and keep this one  without checking "America/Vancouver"
Add a case to test withtout the ":"
This commit is contained in:
Frank Yung-Fong Tang 2021-09-17 12:31:26 -07:00 committed by Rick Waldron
parent ef697bbc6d
commit 0c161cb803
1 changed files with 3 additions and 15 deletions

View File

@ -23,20 +23,8 @@ assert.sameValue(result3.timeZone.id, "-07:00", "date-time + offset is the offse
const result4 = Temporal.Now.zonedDateTime("iso8601", { timeZone });
assert.sameValue(result4.timeZone.id, "-07:00", "date-time + offset is the offset time zone (string in property bag)");
timeZone = "2021-08-19T17:30[America/Vancouver]";
timeZone = "2021-08-19T17:30-0700";
const result5 = Temporal.Now.zonedDateTime("iso8601", timeZone);
assert.sameValue(result5.timeZone.id, "America/Vancouver", "date-time + IANA annotation is the IANA time zone");
assert.sameValue(result3.timeZone.id, "-07:00", "date-time + offset is the offset time zone");
const result6 = Temporal.Now.zonedDateTime("iso8601", { timeZone });
assert.sameValue(result6.timeZone.id, "America/Vancouver", "date-time + IANA annotation is the IANA time zone (string in property bag)");
timeZone = "2021-08-19T17:30Z[America/Vancouver]";
const result7 = Temporal.Now.zonedDateTime("iso8601", timeZone);
assert.sameValue(result7.timeZone.id, "America/Vancouver", "date-time + Z + IANA annotation is the IANA time zone");
const result8 = Temporal.Now.zonedDateTime("iso8601", { timeZone });
assert.sameValue(result8.timeZone.id, "America/Vancouver", "date-time + Z + IANA annotation is the IANA time zone (string in property bag)");
timeZone = "2021-08-19T17:30-07:00[America/Vancouver]";
const result9 = Temporal.Now.zonedDateTime("iso8601", timeZone);
assert.sameValue(result9.timeZone.id, "America/Vancouver", "date-time + offset + IANA annotation is the IANA time zone");
const result10 = Temporal.Now.zonedDateTime("iso8601", { timeZone });
assert.sameValue(result10.timeZone.id, "America/Vancouver", "date-time + offset + IANA annotation is the IANA time zone (string in property bag)");
assert.sameValue(result4.timeZone.id, "-07:00", "date-time + offset is the offset time zone (string in property bag)");