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:
parent
31f65b8c50
commit
795e077eb8
6 changed files with 76 additions and 0 deletions
|
@ -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);
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue