Creating date's prior to 1 Mar 1000 will create a date object a day too early. Here's example code: // Correct dates new Date("1 Jan 1900"); // Mon Jan 01 1900 00:00:00 GMT+0000 (GMT) new Date("1 Jan 1500"); // Mon Jan 01 1500 00:00:00 GMT+0000 (GMT) new Date("1 Jan 1001"); // Thu Jan 01 1001 00:00:00 GMT+0000 (GMT) new Date("1 Mar 1000"); // Sat Mar 01 1000 00:00:00 GMT+0000 (GMT) // In correct dates new Date("28 Feb 1000"); // Thu Feb 27 1000 00:00:00 GMT+0000 (GMT) new Date("1 Dec 988"); // Sun Nov 30 0988 00:00:00 GMT+0000 (GMT)
Created attachment 227674 [details] Patch There were a bug in the leap year check, so I fixed it, and added new test to show that it's working.
Comment on attachment 227674 [details] Patch Attachment 227674 [details] did not pass mac-ews (mac): Output: http://webkit-queues.appspot.com/results/5436077191987200 New failing tests: http/tests/cookies/simple-cookies-expired.html http/tests/cache/subresource-expiration-1.html sputnik/Conformance/15_Native_Objects/15.5_String/15.5.4/15.5.4.7_String.prototype.indexOf/S15.5.4.7_A1_T11.html js/dom/date-big-constructor.html js/date-parse-test.html http/tests/cache/subresource-expiration-2.html http/tests/misc/last-modified-parsing.html js/dom/date-DST-time-cusps.html js/date-parse-comments-test.html js/date-constructor.html js/date-toisostring.html js/dom/date-big-setdate.html
Created attachment 227683 [details] Archive of layout-test-results from webkit-ews-05 for mac-mountainlion The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: webkit-ews-05 Port: mac-mountainlion Platform: Mac OS X 10.8.5
Comment on attachment 227674 [details] Patch Attachment 227674 [details] did not pass mac-wk2-ews (mac-wk2): Output: http://webkit-queues.appspot.com/results/4903125974515712 New failing tests: http/tests/cookies/simple-cookies-expired.html js/date-constructor.html sputnik/Conformance/15_Native_Objects/15.5_String/15.5.4/15.5.4.7_String.prototype.indexOf/S15.5.4.7_A1_T11.html js/dom/date-big-constructor.html js/date-parse-test.html http/tests/misc/last-modified-parsing.html js/dom/date-DST-time-cusps.html js/date-parse-comments-test.html js/date-toisostring.html js/dom/date-big-setdate.html
Created attachment 227698 [details] Archive of layout-test-results from webkit-ews-14 for mac-mountainlion-wk2 The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews. Bot: webkit-ews-14 Port: mac-mountainlion-wk2 Platform: Mac OS X 10.8.5
Created attachment 227745 [details] Patch v2 Fixed the time zone problem.
Comment on attachment 227745 [details] Patch v2 Attachment 227745 [details] did not pass mac-wk2-ews (mac-wk2): Output: http://webkit-queues.appspot.com/results/5104956688302080 New failing tests: http/tests/cookies/simple-cookies-expired.html js/date-constructor.html sputnik/Conformance/15_Native_Objects/15.5_String/15.5.4/15.5.4.7_String.prototype.indexOf/S15.5.4.7_A1_T11.html js/dom/date-big-constructor.html js/date-parse-test.html http/tests/misc/last-modified-parsing.html js/dom/date-DST-time-cusps.html js/date-parse-comments-test.html js/date-toisostring.html js/dom/date-big-setdate.html
Created attachment 227747 [details] Archive of layout-test-results from webkit-ews-11 for mac-mountainlion-wk2 The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews. Bot: webkit-ews-11 Port: mac-mountainlion-wk2 Platform: Mac OS X 10.8.5
Comment on attachment 227745 [details] Patch v2 Attachment 227745 [details] did not pass mac-ews (mac): Output: http://webkit-queues.appspot.com/results/5197840187916288 New failing tests: http/tests/cookies/simple-cookies-expired.html http/tests/cache/subresource-expiration-1.html sputnik/Conformance/15_Native_Objects/15.5_String/15.5.4/15.5.4.7_String.prototype.indexOf/S15.5.4.7_A1_T11.html js/dom/date-big-constructor.html js/date-parse-test.html http/tests/cache/subresource-expiration-2.html http/tests/misc/last-modified-parsing.html js/dom/date-DST-time-cusps.html js/date-parse-comments-test.html js/date-constructor.html js/date-toisostring.html js/dom/date-big-setdate.html
Created attachment 227749 [details] Archive of layout-test-results from webkit-ews-05 for mac-mountainlion The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: webkit-ews-05 Port: mac-mountainlion Platform: Mac OS X 10.8.5
Created attachment 227752 [details] Patch v3
Comment on attachment 227752 [details] Patch v3 Attachment 227752 [details] did not pass mac-wk2-ews (mac-wk2): Output: http://webkit-queues.appspot.com/results/5727751910719488 New failing tests: http/tests/cookies/simple-cookies-expired.html js/date-constructor.html sputnik/Conformance/15_Native_Objects/15.5_String/15.5.4/15.5.4.7_String.prototype.indexOf/S15.5.4.7_A1_T11.html js/dom/date-big-constructor.html js/date-parse-test.html http/tests/misc/last-modified-parsing.html js/dom/date-DST-time-cusps.html js/date-parse-comments-test.html js/date-toisostring.html js/dom/date-big-setdate.html
Created attachment 227757 [details] Archive of layout-test-results from webkit-ews-15 for mac-mountainlion-wk2 The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews. Bot: webkit-ews-15 Port: mac-mountainlion-wk2 Platform: Mac OS X 10.8.5
Comment on attachment 227752 [details] Patch v3 Attachment 227752 [details] did not pass mac-ews (mac): Output: http://webkit-queues.appspot.com/results/5664647029981184 New failing tests: http/tests/cookies/simple-cookies-expired.html http/tests/cache/subresource-expiration-1.html sputnik/Conformance/15_Native_Objects/15.5_String/15.5.4/15.5.4.7_String.prototype.indexOf/S15.5.4.7_A1_T11.html js/dom/date-big-constructor.html js/date-parse-test.html http/tests/cache/subresource-expiration-2.html http/tests/misc/last-modified-parsing.html js/dom/date-DST-time-cusps.html js/date-parse-comments-test.html js/date-constructor.html js/date-toisostring.html js/dom/date-big-setdate.html
Created attachment 227761 [details] Archive of layout-test-results from webkit-ews-04 for mac-mountainlion The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: webkit-ews-04 Port: mac-mountainlion Platform: Mac OS X 10.8.5
(In reply to comment #0) > Creating date's prior to 1 Mar 1000 will create a date object a day too early. > > Here's example code: > > > // Correct dates > new Date("1 Jan 1900"); // Mon Jan 01 1900 00:00:00 GMT+0000 (GMT) > new Date("1 Jan 1500"); // Mon Jan 01 1500 00:00:00 GMT+0000 (GMT) > new Date("1 Jan 1001"); // Thu Jan 01 1001 00:00:00 GMT+0000 (GMT) > new Date("1 Mar 1000"); // Sat Mar 01 1000 00:00:00 GMT+0000 (GMT) > > // In correct dates > new Date("28 Feb 1000"); // Thu Feb 27 1000 00:00:00 GMT+0000 (GMT) > new Date("1 Dec 988"); // Sun Nov 30 0988 00:00:00 GMT+0000 (GMT) https://trac.webkit.org/changeset/165667 fixed these failing tests too. *** This bug has been marked as a duplicate of bug 130123 ***
Otherwise we could add new test cases to avoid future regressions.
Created attachment 228847 [details] Tests The missing tests for this bug.
Comment on attachment 228847 [details] Tests Could you re-upload a version that correctly applies so that the EWS can run the tests?
Reopening to attach new patch.
Created attachment 229029 [details] Patch patch for landing
Comment on attachment 229029 [details] Patch Attachment 229029 [details] did not pass mac-ews (mac): Output: http://webkit-queues.appspot.com/results/6720383478661120 New failing tests: js/date-constructor.html
Created attachment 229037 [details] Archive of layout-test-results from webkit-ews-08 for mac-mountainlion The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: webkit-ews-08 Port: mac-mountainlion Platform: Mac OS X 10.8.5
failures: FAIL new Date(Date.parse('28 Feb 1000 GMT')).toGMTString() should be Thu, 28 Feb 1000 00:00:00 GMT. Was Fri, 28 Feb 1000 00:00:00 GMT. FAIL new Date(Date.parse('1 Dec 988 GMT')).toGMTString() should be Sun, 01 Dec 0988 00:00:00 GMT. Was Mon, 01 Dec 0988 00:00:00 GMT.
Comment on attachment 229029 [details] Patch Attachment 229029 [details] did not pass mac-wk2-ews (mac-wk2): Output: http://webkit-queues.appspot.com/results/5010492573614080 New failing tests: js/date-constructor.html
Created attachment 229038 [details] Archive of layout-test-results from webkit-ews-12 for mac-mountainlion-wk2 The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews. Bot: webkit-ews-12 Port: mac-mountainlion-wk2 Platform: Mac OS X 10.8.5
Comment on attachment 229029 [details] Patch Attachment 229029 [details] did not pass mac-ews (mac): Output: http://webkit-queues.appspot.com/results/5718194736070656 New failing tests: js/date-constructor.html
Created attachment 229039 [details] Archive of layout-test-results from webkit-ews-01 for mac-mountainlion The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: webkit-ews-01 Port: mac-mountainlion Platform: Mac OS X 10.8.5
Comment on attachment 229029 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=229029&action=review > LayoutTests/js/script-tests/date-constructor.js:51 > +shouldBe("new Date(Date.parse('28 Feb 1000 GMT')).toGMTString()", "\"Thu, 28 Feb 1000 00:00:00 GMT\""); > +shouldBe("new Date(Date.parse('1 Dec 988 GMT')).toGMTString()", "\"Sun, 01 Dec 0988 00:00:00 GMT\""); > +shouldBe("new Date(Date.parse('1 Mar 1000 GMT')).toGMTString()", "\"Sat, 01 Mar 1000 00:00:00 GMT\""); It seems only the results should be updated: - 01 Mar 1000 - it is next to 28 Feb 1000, so it is friday - 01 Dec 0988 - it is monday as WebKit says now
Created attachment 229049 [details] Patch v2 Fixed tests.
Comment on attachment 229049 [details] Patch v2 View in context: https://bugs.webkit.org/attachment.cgi?id=229049&action=review > LayoutTests/ChangeLog:3 > + (before-mar-1-1000) In correct date creation prior to 1 Mar 1000 incorrect spelling of incorrect here
Comment on attachment 229049 [details] Patch v2 Clearing flags on attachment: 229049 Committed r167184: <http://trac.webkit.org/changeset/167184>
All reviewed patches have been landed. Closing bug.