mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-21 18:00:16 +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
|
@ -23,6 +23,17 @@ describe("correct behavior", () => {
|
|||
expect(createdPlainTime.microsecond).toBe(0);
|
||||
expect(createdPlainTime.nanosecond).toBe(0);
|
||||
});
|
||||
|
||||
test("ZonedDateTime instance argument", () => {
|
||||
const zonedDateTime = new Temporal.ZonedDateTime(1627318123456789000n, "UTC");
|
||||
const createdPlainTime = Temporal.PlainTime.from(zonedDateTime);
|
||||
expect(createdPlainTime.hour).toBe(16);
|
||||
expect(createdPlainTime.minute).toBe(48);
|
||||
expect(createdPlainTime.second).toBe(43);
|
||||
expect(createdPlainTime.millisecond).toBe(456);
|
||||
expect(createdPlainTime.microsecond).toBe(789);
|
||||
expect(createdPlainTime.nanosecond).toBe(0);
|
||||
});
|
||||
});
|
||||
|
||||
describe("errors", () => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue