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

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

This commit is contained in:
Linus Groh 2021-08-23 23:27:41 +01:00 committed by Andreas Kling
parent 5573efa3bd
commit fc58f93734
3 changed files with 41 additions and 0 deletions

View file

@ -0,0 +1,13 @@
describe("correct behavior", () => {
test("length is 0", () => {
expect(Temporal.PlainDateTime.prototype.toPlainMonthDay).toHaveLength(0);
});
test("basic functionality", () => {
const plainDateTime = new Temporal.PlainDateTime(2021, 7, 6, 18, 14, 47);
const plainMonthDay = plainDateTime.toPlainMonthDay();
expect(plainMonthDay.calendar).toBe(plainDateTime.calendar);
expect(plainMonthDay.monthCode).toBe("M07");
expect(plainMonthDay.day).toBe(6);
});
});