1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 21:47:46 +00:00

LibJS: Support MM/DD/YYYY HH:MM <timezone-offset> format for Date

Required by Discord to determine if it should show Christmas themed
loading tips on the loading screen.
Fixes #16473.
This commit is contained in:
Luke Wilde 2022-12-13 20:26:10 +00:00 committed by Linus Groh
parent bb6a84cc85
commit ce39c907fd
2 changed files with 10 additions and 2 deletions

View file

@ -78,3 +78,9 @@ test("extra date extension", () => {
expectStringToGiveDate("7/07/1977", 1977, 7, 7);
expectStringToGiveDate("2/27/3058", 3058, 2, 27);
});
test("mm/dd/yy hh:mm timezone-offset extension", () => {
// Examples from Discord's JavaScript for Christmas 2022.
expect(Date.parse("12/05/2022 10:00 -0800")).toBe(1670263200000);
expect(Date.parse("01/03/2023 10:00 -0800")).toBe(1672768800000);
});