mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-30 20:59:16 +00:00
LibJS: Implement Date's string constructor
... by calling Date.parse(). With this, dates on http://45.33.8.238/ and http://45.33.8.238/linux/summary.html are correctly converted to local time :^)
This commit is contained in:
parent
6e5aa5d5df
commit
116c0c0ab3
Notes:
sideshowbarker
2024-07-19 03:20:46 +09:00
Author: https://github.com/nico
Commit: 116c0c0ab3
Pull-request: https://github.com/SerenityOS/serenity/pull/3249
2 changed files with 12 additions and 11 deletions
|
@ -4,6 +4,12 @@ test("basic functionality", () => {
|
|||
expect(Date.prototype).not.toHaveProperty("length");
|
||||
});
|
||||
|
||||
test("string constructor", () => {
|
||||
// The string constructor is the same as calling the timestamp constructor with the result of Date.parse(arguments).
|
||||
// Since that has exhaustive tests in Date.parse.js, just do some light smoke testing here.
|
||||
expect(new Date("2017-09-07T21:08:59.001Z").toISOString()).toBe("2017-09-07T21:08:59.001Z");
|
||||
});
|
||||
|
||||
test("timestamp constructor", () => {
|
||||
// The timestamp constructor takes a timestamp in milliseconds since the start of the epoch, in UTC.
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue