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

This commit is contained in:
Linus Groh 2021-07-23 00:39:18 +01:00
commit 18fd0d4011
Notes: sideshowbarker 2024-07-18 08:30:05 +09:00
4 changed files with 28 additions and 0 deletions

View file

@ -0,0 +1,11 @@
describe("normal behavior", () => {
test("length is 0", () => {
expect(Temporal.PlainDateTime.prototype.toPlainDate).toHaveLength(0);
});
test("basic functionality", () => {
const plainDateTime = new Temporal.PlainDateTime(2021, 7, 23, 0, 32, 18, 123, 456, 789);
const plainDate = plainDateTime.toPlainDate();
expect(plainDate.equals(new Temporal.PlainDate(2021, 7, 23))).toBeTrue();
});
});