mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-04 05:20:30 +00:00
LibJS: Allow date format "YYYY-M-DD"
Some checks are pending
CI / Lagom (false, FUZZ, ubuntu-22.04, Linux, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, macos-14, macOS, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, ubuntu-22.04, Linux, GNU) (push) Waiting to run
CI / Lagom (true, NO_FUZZ, ubuntu-22.04, Linux, Clang) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (macos-14, macOS, macOS-universal2) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (ubuntu-22.04, Linux, Linux-x86_64) (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Push notes / build (push) Waiting to run
Some checks are pending
CI / Lagom (false, FUZZ, ubuntu-22.04, Linux, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, macos-14, macOS, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, ubuntu-22.04, Linux, GNU) (push) Waiting to run
CI / Lagom (true, NO_FUZZ, ubuntu-22.04, Linux, Clang) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (macos-14, macOS, macOS-universal2) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (ubuntu-22.04, Linux, Linux-x86_64) (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Push notes / build (push) Waiting to run
This commit is contained in:
parent
6481ef821d
commit
b4d996680a
Notes:
github-actions[bot]
2024-09-15 16:25:28 +00:00
Author: https://github.com/Arhcout Commit: https://github.com/LadybirdBrowser/ladybird/commit/b4d996680a2 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1398
2 changed files with 3 additions and 1 deletions
|
@ -180,6 +180,7 @@ static double parse_date_string(VM& vm, ByteString const& date_string)
|
|||
"%a%t%b%t%e%t%T%t%Y"sv, // "Wed Apr 17 23:08:53 2019"
|
||||
"%Y-%m-%eT%T%X%z"sv, // "2024-01-26T22:10:11.306+0000"
|
||||
"%m/%e/%Y,%t%T%t%p"sv, // "1/27/2024, 9:28:30 AM"
|
||||
"%Y-%m-%e"sv, // "2024-1-15"
|
||||
};
|
||||
|
||||
for (auto const& format : extra_formats) {
|
||||
|
|
|
@ -16,6 +16,8 @@ test("basic functionality", () => {
|
|||
|
||||
const originalTimeZone = setTimeZone("UTC");
|
||||
|
||||
expect(Date.parse("1980-5-30")).toBe(328492800000);
|
||||
|
||||
setTimeZone("America/Chicago");
|
||||
expect(Date.parse("Jan 01 1970 GMT")).toBe(0);
|
||||
expect(Date.parse("Wed Apr 17 23:08:53 2019 +0000")).toBe(1555542533000);
|
||||
|
@ -42,7 +44,6 @@ test("basic functionality", () => {
|
|||
expect(Date.parse("1980-05-00T")).toBe(NaN);
|
||||
expect(Date.parse("1980-05-00T15:15:")).toBe(NaN);
|
||||
expect(Date.parse("1980-05-00T15:15:15.")).toBe(NaN);
|
||||
expect(Date.parse("1980-5-30")).toBe(NaN);
|
||||
expect(Date.parse("1980-05-30T13")).toBe(NaN);
|
||||
expect(Date.parse("1980-05-30T13:4")).toBe(NaN);
|
||||
expect(Date.parse("1980-05-30T13:40+")).toBe(NaN);
|
||||
|
|
Loading…
Reference in a new issue