1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-06-01 03:08:13 +00:00

LibJS: Fix production for time zone name in time zone strings

This is a normative change in the Temporal spec.

See:
- caf013a
- fb7cfa6
This commit is contained in:
Linus Groh 2022-06-27 23:18:10 +01:00
parent f5669a1373
commit 3720f4bd8f
5 changed files with 11 additions and 29 deletions

View file

@ -25,18 +25,18 @@ describe("normal behavior", () => {
["Europe/London", "Europe/London"],
["Europe/Isle_of_Man", "Europe/London"],
["1970-01-01+01", "+01:00"],
["1970-01-01+01[-12:34]", "+01:00"],
["1970-01-01+01[-12:34]", "-12:34"],
["1970-01-01T00:00:00+01", "+01:00"],
["1970-01-01T00:00:00.000000000+01", "+01:00"],
["1970-01-01T00:00:00.000000000+01:00:00", "+01:00"],
["1970-01-01+12:34", "+12:34"],
["1970-01-01+12:34:56", "+12:34:56"],
["1970-01-01+12:34:56.789", "+12:34:56.789"],
["1970-01-01+12:34:56.789[-01:00]", "+12:34:56.789"],
["1970-01-01+12:34:56.789[-01:00]", "-01:00"],
["1970-01-01-12:34", "-12:34"],
["1970-01-01-12:34:56", "-12:34:56"],
["1970-01-01-12:34:56.789", "-12:34:56.789"],
["1970-01-01-12:34:56.789[+01:00]", "-12:34:56.789"],
["1970-01-01-12:34:56.789[+01:00]", "+01:00"],
];
for (const [arg, expected] of values) {
expect(Temporal.TimeZone.from(arg).id).toBe(expected);