LibJS: Parse dates like "November 19 2024 00:00:00 +0900"

This format is used on https://jojowiki.com/ to show countdowns to new
releases.
This commit is contained in:
Luke Wilde 2024-11-12 11:05:05 +00:00 committed by Jelle Raaijmakers
commit 956b279ae1
Notes: github-actions[bot] 2024-11-12 12:24:27 +00:00
2 changed files with 2 additions and 0 deletions

View file

@ -40,6 +40,7 @@ test("basic functionality", () => {
expect(Date.parse("1/27/2024, 9:28:30 AM")).toBe(1706369310000);
expect(Date.parse("01 February 2013")).toBe(1359698400000);
expect(Date.parse("Tuesday, October 29, 2024, 18:00 UTC")).toBe(1730224800000);
expect(Date.parse("November 19 2024 00:00:00 +0900")).toBe(1731942000000);
// FIXME: Create a scoped time zone helper when bytecode supports the `using` declaration.
setTimeZone(originalTimeZone);