LibJS: Handle ZonedDateTime in the various Temporal factories

This commit is contained in:
Timothy Flynn 2024-11-25 07:24:24 -05:00 committed by Andreas Kling
commit 3e6133cc09
Notes: github-actions[bot] 2024-11-26 10:04:16 +00:00
8 changed files with 97 additions and 19 deletions

View file

@ -17,6 +17,14 @@ describe("correct behavior", () => {
expect(createdPlainDate.month).toBe(7);
expect(createdPlainDate.day).toBe(26);
});
test("ZonedDateTime instance argument", () => {
const zonedDateTime = new Temporal.ZonedDateTime(1627318123456789000n, "UTC");
const createdPlainDate = Temporal.PlainDate.from(zonedDateTime);
expect(createdPlainDate.year).toBe(2021);
expect(createdPlainDate.month).toBe(7);
expect(createdPlainDate.day).toBe(26);
});
});
describe("errors", () => {