mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-02 15:46:33 +00:00
LibJS: Handle ZonedDateTime in the various Temporal factories
This commit is contained in:
parent
8c73cae2b8
commit
3e6133cc09
Notes:
github-actions[bot]
2024-11-26 10:04:16 +00:00
Author: https://github.com/trflynn89
Commit: 3e6133cc09
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2577
Reviewed-by: https://github.com/shannonbooth ✅
8 changed files with 97 additions and 19 deletions
|
@ -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", () => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue