LibJS: Implement the ECMA-402 PlainDateTime.prototype.toLocaleString.js

This commit is contained in:
Timothy Flynn 2024-11-27 16:32:43 -05:00 committed by Andreas Kling
commit c96f6c396f
Notes: github-actions[bot] 2024-11-29 08:53:10 +00:00
2 changed files with 26 additions and 5 deletions

View file

@ -4,8 +4,19 @@ describe("correct behavior", () => {
});
test("basic functionality", () => {
const plainDateTime = new Temporal.PlainDateTime(2021, 11, 3, 1, 33, 5, 100, 200, 300);
expect(plainDateTime.toLocaleString()).toBe("2021-11-03T01:33:05.1002003");
const plainDateTime = new Temporal.PlainDateTime(
2021,
11,
3,
1,
33,
5,
100,
200,
300,
"gregory"
);
expect(plainDateTime.toLocaleString()).toBe("11/3/2021, 1:33:05 AM");
});
});