diff --git a/dlls/jscript/date.c b/dlls/jscript/date.c index 5e5ef1c3c6..6d98fcde3b 100644 --- a/dlls/jscript/date.c +++ b/dlls/jscript/date.c @@ -2132,7 +2132,7 @@ static inline HRESULT date_parse(jsstr_t *input_str, double *ret) { } } else if(parse[i]=='-' || parse[i]=='/') { - /* Short date */ + /* Short or long date */ if(set_day || set_month || set_year) break; set_day = TRUE; set_month = TRUE; @@ -2152,6 +2152,13 @@ static inline HRESULT date_parse(jsstr_t *input_str, double *ret) { if(parse[i]<'0' || parse[i]>'9') break; year = atoiW(&parse[i]); while(parse[i]>='0' && parse[i]<='9') i++; + + if(tmp >= 70){ + /* long date */ + month = day - 1; + day = year; + year = tmp; + } } else if(tmp<0) break; else if(tmp<70) { diff --git a/dlls/jscript/tests/api.js b/dlls/jscript/tests/api.js index e1f91c0e0e..f4f42b022d 100644 --- a/dlls/jscript/tests/api.js +++ b/dlls/jscript/tests/api.js @@ -2013,6 +2013,8 @@ ok(Date.parse("February 31 UTC, 2000 12:31:17 PM") === 952000277000, "Date.parse(\"February 31 UTC, 2000 12:31:17 PM\") = " + Date.parse("February 31 UTC, 2000 12:31:17 PM")); ok(Date.parse("71 11:32AM Dec 12 UTC BC ") === -64346358480000, "Date.parse(\"71 11:32AM Dec 12 UTC BC \") = " + Date.parse("71 11:32AM Dec 12 UTC BC ")); ok(Date.parse("23/71/2000 11::32::UTC") === 1010662320000, "Date.parse(\"23/71/2000 11::32::UTC\") = " + Date.parse("23/71/2000 11::32::UTC")); +ok(Date.parse("1970/01/01") === Date.parse("01/01/1970"), "Date.parse(\"1970/01/01\") = " + Date.parse("1970/01/01")); +ok(Date.parse("71/12/14") === Date.parse("12/14/1971"), "Date.parse(\"71/12/14\") = " + Date.parse("71/12/14")); ok(typeof(Math.PI) === "number", "typeof(Math.PI) = " + typeof(Math.PI)); ok(Math.floor(Math.PI*100) === 314, "Math.PI = " + Math.PI);