RESOLVED FIXED 8722
IE compatibility fix in date parsing
https://bugs.webkit.org/show_bug.cgi?id=8722
Summary IE compatibility fix in date parsing
George Staikos
Reported 2006-05-03 10:21:43 PDT
This patch was provided by a KDE developer to make our date parser more IE-compatible. To quote: "it seems that quite a lot of broken Javascript code fail on Date.parse(txt) when txt is in the 'xx/xx/xxxx' format (dd/mm/yyyy in France, mm/dd/yyyy elsewhere)."
Attachments
Our updated testcase file (12.80 KB, text/plain)
2006-05-03 10:22 PDT, George Staikos
no flags
The patch (855 bytes, patch)
2006-05-03 10:23 PDT, George Staikos
mjs: review+
George Staikos
Comment 1 2006-05-03 10:22:34 PDT
Created attachment 8096 [details] Our updated testcase file
George Staikos
Comment 2 2006-05-03 10:23:18 PDT
Created attachment 8097 [details] The patch
Darin Adler
Comment 3 2006-05-03 10:39:23 PDT
Comment on attachment 8097 [details] The patch Looks good, but we need a test case. We normally don't land bug fixes without test cases.
Darin Adler
Comment 4 2006-05-03 11:19:52 PDT
(In reply to comment #3) > (From update of attachment 8097 [details] [edit]) > Looks good, but we need a test case. We normally don't land bug fixes without > test cases. Oh, I see the test case now. Patch needs to include the change to the test case and/or test results inside LayoutTests.
George Staikos
Comment 5 2006-05-03 13:07:04 PDT
Here is the relevant test: +// Tolerance for high values in xx/xx/xxxx + +shouldBe("Date.parse('Mar 30 2006')", "1143669600000"); +shouldBe("Date.parse('30/03/2006')", "1212444000000"); +shouldBe("Date.parse('03/30/2006')", "1143669600000"); +shouldBe("Date.parse('24/55/2006')", "1201129200000"); +shouldBe("Date.parse('70/55/2006')", "315097200000"); +shouldBe("Date.parse('00/00/2006')", "1133305200000"); +shouldBe("Date.parse('01/452/2006')", "1175032800000"); +
Alexey Proskuryakov
Comment 6 2006-05-03 23:38:43 PDT
(In reply to comment #5) These results do not match what I get from WinIE 6. For example, the first result is 1143662400000 here.
George Staikos
Comment 7 2006-05-04 09:40:27 PDT
I think that was a testcase problem. Updated testcases: // Tolerance for high values in xx/xx/xxxx +shouldBe("new Date('03/30/2006').getDate()", "30"); +shouldBe("new Date('Mar 30 2006').toString()", "new Date('03/30/2006').toString()"); +shouldBe("new Date('30/03/2006').toString()", "new Date('Jun 03 2008').toString()"); +shouldBe("new Date('24/55/2006').getFullYear()", "2008"); +shouldBe("new Date('70/55/2006').getDate()", "27"); +shouldBe("new Date('00/00/2006').toString()", "new Date('Nov 30 2005').toString()"); +shouldBe("new Date('01/452/2006').toString()", "new Date('Mar 28 2007').toString()");
Maciej Stachowiak
Comment 8 2006-05-04 13:32:32 PDT
r=me, make sure to add the test cases to LayoutTests/fast/js/kde when landing. Alexey says the new test cases are right in IE.
Darin Adler
Comment 9 2006-05-05 07:57:49 PDT
Comment on attachment 8097 [details] The patch This patch doesn't apply to TOT -- the code is different.
Note You need to log in before you can comment on or make changes to this bug.