1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 05:17:35 +00:00

LibJS: Emit reference information for { calendarName: "always" } option

This is a normative change in the Temporal spec.

See: 4f7519a
This commit is contained in:
Linus Groh 2022-03-30 17:56:30 +01:00
parent 29aa938fa5
commit b5392f9e39
4 changed files with 8 additions and 6 deletions

View file

@ -9,7 +9,7 @@ describe("correct behavior", () => {
plainMonthDay = new Temporal.PlainMonthDay(7, 6);
expect(plainMonthDay.toString()).toBe("07-06");
expect(plainMonthDay.toString({ calendarName: "auto" })).toBe("07-06");
expect(plainMonthDay.toString({ calendarName: "always" })).toBe("07-06[u-ca=iso8601]");
expect(plainMonthDay.toString({ calendarName: "always" })).toBe("1972-07-06[u-ca=iso8601]");
expect(plainMonthDay.toString({ calendarName: "never" })).toBe("07-06");
plainMonthDay = new Temporal.PlainMonthDay(7, 6, { toString: () => "foo" }, 2021);

View file

@ -9,7 +9,9 @@ describe("correct behavior", () => {
plainYearMonth = new Temporal.PlainYearMonth(2021, 7);
expect(plainYearMonth.toString()).toBe("2021-07");
expect(plainYearMonth.toString({ calendarName: "auto" })).toBe("2021-07");
expect(plainYearMonth.toString({ calendarName: "always" })).toBe("2021-07[u-ca=iso8601]");
expect(plainYearMonth.toString({ calendarName: "always" })).toBe(
"2021-07-01[u-ca=iso8601]"
);
expect(plainYearMonth.toString({ calendarName: "never" })).toBe("2021-07");
plainYearMonth = new Temporal.PlainYearMonth(2021, 7, { toString: () => "foo" }, 6);