mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-02 22:30:31 +00:00
LibJS: Implement Temporal.Now.zonedDateTimeISO()
This commit is contained in:
parent
36c79c2989
commit
a06bd451d4
Notes:
sideshowbarker
2024-07-18 07:37:45 +09:00
Author: https://github.com/linusg
Commit: a06bd451d4
Pull-request: https://github.com/SerenityOS/serenity/pull/9160
Reviewed-by: https://github.com/IdanHo ✅
4 changed files with 35 additions and 1 deletions
|
@ -0,0 +1,19 @@
|
|||
describe("correct behavior", () => {
|
||||
test("length is 0", () => {
|
||||
expect(Temporal.Now.zonedDateTimeISO).toHaveLength(0);
|
||||
});
|
||||
|
||||
test("basic functionality", () => {
|
||||
const zonedDateTime = Temporal.Now.zonedDateTimeISO();
|
||||
expect(zonedDateTime).toBeInstanceOf(Temporal.ZonedDateTime);
|
||||
expect(zonedDateTime.calendar.id).toBe("iso8601");
|
||||
});
|
||||
|
||||
test("with time zone", () => {
|
||||
const timeZone = new Temporal.TimeZone("UTC");
|
||||
const zonedDateTime = Temporal.Now.zonedDateTimeISO(timeZone);
|
||||
expect(zonedDateTime).toBeInstanceOf(Temporal.ZonedDateTime);
|
||||
expect(zonedDateTime.calendar.id).toBe("iso8601");
|
||||
expect(zonedDateTime.timeZone).toBe(timeZone);
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue