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

LibJS: Add Temporal.Calendar.prototype.dateFromFields & required AOs

This is required for implementing the DateFromFields PlainDate AO.
This commit is contained in:
Idan Horowitz 2021-07-21 22:17:40 +03:00 committed by Linus Groh
parent 7a33a5c9b5
commit 1e471e2e2f
11 changed files with 350 additions and 1 deletions

View file

@ -0,0 +1,11 @@
describe("correct behavior", () => {
test("length is 2", () => {
expect(Temporal.Calendar.prototype.dateFromFields).toHaveLength(2);
});
test("basic functionality", () => {
const calendar = new Temporal.Calendar("iso8601");
const date = calendar.dateFromFields({ year: 2000, month: 5, day: 2 });
expect(date.calendar).toBe(calendar);
});
});