1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 21:07:34 +00:00

LibJS: Implement Temporal.ZonedDateTime.prototype.toPlainYearMonth()

This commit is contained in:
Linus Groh 2021-08-23 23:35:59 +01:00 committed by Andreas Kling
parent fc58f93734
commit ef581be4ec
3 changed files with 54 additions and 0 deletions

View file

@ -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);
});
});