mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-02 22:30:31 +00:00
LibJS: Implement Temporal.ZonedDateTime.prototype.toPlainYearMonth()
This commit is contained in:
parent
fc58f93734
commit
ef581be4ec
Notes:
sideshowbarker
2024-07-18 05:20:13 +09:00
Author: https://github.com/linusg
Commit: ef581be4ec
Pull-request: https://github.com/SerenityOS/serenity/pull/9589
3 changed files with 54 additions and 0 deletions
|
@ -0,0 +1,14 @@
|
|||
describe("correct behavior", () => {
|
||||
test("length is 0", () => {
|
||||
expect(Temporal.ZonedDateTime.prototype.toPlainYearMonth).toHaveLength(0);
|
||||
});
|
||||
|
||||
test("basic functionality", () => {
|
||||
const timeZone = new Temporal.TimeZone("UTC");
|
||||
const zonedDateTime = new Temporal.ZonedDateTime(1625614921000000000n, timeZone);
|
||||
const plainYearMonth = zonedDateTime.toPlainYearMonth();
|
||||
expect(plainYearMonth.calendar).toBe(zonedDateTime.calendar);
|
||||
expect(plainYearMonth.year).toBe(2021);
|
||||
expect(plainYearMonth.month).toBe(7);
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue