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

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

This commit is contained in:
Linus Groh 2021-08-23 23:40:24 +01:00 committed by Andreas Kling
parent ef581be4ec
commit 6ce05026b4
3 changed files with 53 additions and 0 deletions

View file

@ -0,0 +1,14 @@
describe("correct behavior", () => {
test("length is 0", () => {
expect(Temporal.ZonedDateTime.prototype.toPlainMonthDay).toHaveLength(0);
});
test("basic functionality", () => {
const timeZone = new Temporal.TimeZone("UTC");
const zonedDateTime = new Temporal.ZonedDateTime(1625614921000000000n, timeZone);
const plainMonthDay = zonedDateTime.toPlainMonthDay();
expect(plainMonthDay.calendar).toBe(zonedDateTime.calendar);
expect(plainMonthDay.monthCode).toBe("M07");
expect(plainMonthDay.day).toBe(6);
});
});