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)."
Created attachment 8096 [details] Our updated testcase file
Created attachment 8097 [details] The patch
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.
(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.
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"); +
(In reply to comment #5) These results do not match what I get from WinIE 6. For example, the first result is 1143662400000 here.
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()");
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.
Comment on attachment 8097 [details] The patch This patch doesn't apply to TOT -- the code is different.