mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 12:57:35 +00:00
LibJS: Implement Temporal.Calendar.prototype.dateAdd()
This commit is contained in:
parent
f492e98f19
commit
e3254bf4c5
6 changed files with 94 additions and 0 deletions
|
@ -0,0 +1,15 @@
|
|||
describe("correct behavior", () => {
|
||||
test("length is 3", () => {
|
||||
expect(Temporal.Calendar.prototype.dateAdd).toHaveLength(3);
|
||||
});
|
||||
|
||||
test("basic functionality", () => {
|
||||
const calendar = new Temporal.Calendar("iso8601");
|
||||
const plainDate = new Temporal.PlainDate(1970, 1, 1);
|
||||
const duration = new Temporal.Duration(1, 2, 3, 4);
|
||||
const newPlainDate = calendar.dateAdd(plainDate, duration);
|
||||
expect(newPlainDate.year).toBe(1971);
|
||||
expect(newPlainDate.month).toBe(3);
|
||||
expect(newPlainDate.day).toBe(26);
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue