Build fe8a64d can not parse dates, where the month is without a leading zero - unless there is a time part.
Using /Build/lagom/bin/js
:
> new Date ("2024-7-24")
[Date] Invalid Date
> new Date ("2024-7-24 10:00")
[Date] Wed Jul 24 2024 10:00:00 GMT+0200 (Central European Summer Time)
> new Date ("2024-07-24")
[Date] Wed Jul 24 2024 02:00:00 GMT+0200 (Central European Summer Time)
Using V8:
> new Date ("2024-7-24")
2024-07-23T22:00:00.000Z // <- probably not what you want
> new Date ("2024-7-24 10:00")
2024-07-24T08:00:00.000Z
> new Date ("2024-07-24")
2024-07-24T00:00:00.000Z
Using SpiderMonkey:
> new Date ("2024-7-24")
Date Wed Jul 24 2024 02:00:00 GMT+0200 (Central European Summer Time)
> new Date ("2024-7-24 10:00")
Date Wed Jul 24 2024 10:00:00 GMT+0200 (Central European Summer Time)
> new Date ("2024-07-24")
Date Wed Jul 24 2024 02:00:00 GMT+0200 (Central European Summer Time)
Since YYYY-M-DD is not a valid ISO 8601 date, the behaviour is probably undefined in any spec but I've seen it in the wild.
With Ladybird's sister project, also named Ladybird, I saw yesterday on youtube.com, the following error log:
10309.331 WebContent(23165): Unable to parse date string: "2024-7-24"
Log from Ladybird yesterday (2024-09-13)
Today I checked with Serenity's Ladybird and did not see the same error. But I assume the date is dynamic on youtube.com.
Related: #19030 LadybirdBrowser/ladybird#1395
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too