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 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
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 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
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 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
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 ***
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.
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
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
2014-03-24 12:00 PDT, Tibor Mészáros
2014-03-24 12:52 PDT, Build Bot
2014-03-24 15:50 PDT, Build Bot
2014-03-25 06:39 PDT, Tibor Mészáros
2014-03-25 07:38 PDT, Build Bot
2014-03-25 08:00 PDT, Build Bot
2014-03-25 08:21 PDT, Tibor Mészáros
2014-03-25 09:17 PDT, Build Bot
2014-03-25 09:42 PDT, Build Bot
2014-04-08 10:02 PDT, Tibor Mészáros
2014-04-10 01:12 PDT, Csaba Osztrogonác
2014-04-10 02:30 PDT, Build Bot
2014-04-10 03:09 PDT, Build Bot
2014-04-10 03:35 PDT, Build Bot
2014-04-10 07:23 PDT, Tibor Mészáros