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

LibJS: Implement Temporal.PlainDate.prototype.toPlainMonthDay()

This commit is contained in:
Linus Groh 2021-08-16 18:13:47 +01:00
parent 31f65b8c50
commit 795e077eb8
6 changed files with 76 additions and 0 deletions

View file

@ -0,0 +1,15 @@
describe("correct behavior", () => {
test("length is 0", () => {
expect(Temporal.PlainDate.prototype.toPlainMonthDay).toHaveLength(0);
});
test("basic functionality", () => {
const plainDate = new Temporal.PlainDate(2021, 7, 6);
const plainMonthDay = plainDate.toPlainMonthDay();
expect(plainMonthDay.calendar).toBe(plainDate.calendar);
expect(plainMonthDay.monthCode).toBe("M07");
expect(plainMonthDay.day).toBe(6);
const fields = plainMonthDay.getISOFields();
expect(fields.isoYear).toBe(1972);
});
});