Add implementation specific date parsing (#4576)

It is compatible with Firefox and Chrome.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
This commit is contained in:
Zoltan Herczeg
2021-02-09 15:03:06 +01:00
committed by GitHub
parent 53aed02762
commit ec872818c2
2 changed files with 59 additions and 40 deletions
+5 -1
View File
@@ -40,7 +40,7 @@ var wrongFormats = ["",
"2015-01-01T24:00:01.000",
"2015-01-01T24:00:00.001",
"2015-01-01T00:00+01:00Z",
"2015/01/01",
"2015/01-01",
"2015-01-32",
"2015--1",
"2015-13",
@@ -176,3 +176,7 @@ assert (Date.parse("Fri, 31 Dec 9999 23:59:59 GMT") == 253402300799000)
assert (Date.parse("Sat, 01 Jan 10000 00:00:00 GMT") == 253402300800000)
assert (Date.parse("Sat, 13 Sep 275760 00:00:00 GMT") == 8640000000000000)
assert (isNaN(Date.parse("Sat, 13 Sep 275760 00:00:01 GMT"))) // 8640000000001000 - out of range
// Non standard date formats
assert (Date.parse("2000/01/01 12:12Z") == 946728720000)
assert (Date.parse("1991-07-13 16:04Z") == 679421040000)