2011-09-07 08:35:18 +02:00
|
|
|
// Copyright 2009 the Sputnik authors. All rights reserved.
|
|
|
|
// This code is governed by the BSD license found in the LICENSE file.
|
2014-07-22 01:09:02 +02:00
|
|
|
/*---
|
2018-01-05 18:26:51 +01:00
|
|
|
info: |
|
2014-07-22 01:09:02 +02:00
|
|
|
The [[Value]] property of the newly constructed object
|
|
|
|
is set by following steps:
|
|
|
|
8. If Result(1) is not NaN and 0 <= ToInteger(Result(1)) <= 99, Result(8) is
|
|
|
|
1900+ToInteger(Result(1)); otherwise, Result(8) is Result(1)
|
|
|
|
9. Compute MakeDay(Result(8), Result(2), Result(3))
|
|
|
|
10. Compute MakeTime(Result(4), Result(5), Result(6), Result(7))
|
|
|
|
11. Compute MakeDate(Result(9), Result(10))
|
|
|
|
12. Set the [[Value]] property of the newly constructed object to
|
|
|
|
TimeClip(UTC(Result(11)))
|
2017-07-27 23:24:39 +02:00
|
|
|
esid: sec-date-year-month-date-hours-minutes-seconds-ms
|
2014-07-22 01:09:02 +02:00
|
|
|
description: 2 arguments, (year, month)
|
2016-04-19 23:00:59 +02:00
|
|
|
includes: [assertRelativeDateMs.js]
|
2014-07-22 01:09:02 +02:00
|
|
|
---*/
|
2011-09-07 08:35:18 +02:00
|
|
|
|
2016-04-19 23:00:59 +02:00
|
|
|
assertRelativeDateMs(new Date(1899, 11), -2211667200000);
|
2014-07-22 01:09:02 +02:00
|
|
|
|
2016-04-19 23:00:59 +02:00
|
|
|
assertRelativeDateMs(new Date(1899, 12), -2208988800000);
|
2014-07-22 01:09:02 +02:00
|
|
|
|
2016-04-19 23:00:59 +02:00
|
|
|
assertRelativeDateMs(new Date(1900, 0), -2208988800000);
|
2014-07-22 01:09:02 +02:00
|
|
|
|
2016-04-19 23:00:59 +02:00
|
|
|
assertRelativeDateMs(new Date(1969, 11), -2678400000);
|
2014-07-22 01:09:02 +02:00
|
|
|
|
2016-04-19 23:00:59 +02:00
|
|
|
assertRelativeDateMs(new Date(1969, 12), 0);
|
2014-07-22 01:09:02 +02:00
|
|
|
|
2016-04-19 23:00:59 +02:00
|
|
|
assertRelativeDateMs(new Date(1970, 0), 0);
|
2014-07-22 01:09:02 +02:00
|
|
|
|
2016-04-19 23:00:59 +02:00
|
|
|
assertRelativeDateMs(new Date(1999, 11), 944006400000);
|
2014-07-22 01:09:02 +02:00
|
|
|
|
2016-04-19 23:00:59 +02:00
|
|
|
assertRelativeDateMs(new Date(1999, 12), 946684800000);
|
2014-07-22 01:09:02 +02:00
|
|
|
|
2018-02-15 22:40:26 +01:00
|
|
|
assertRelativeDateMs(new Date(2000, 0), 946684800000);
|
2014-07-22 01:09:02 +02:00
|
|
|
|
2016-04-19 23:00:59 +02:00
|
|
|
assertRelativeDateMs(new Date(2099, 11), 4099766400000);
|
2014-07-22 01:09:02 +02:00
|
|
|
|
2016-04-19 23:00:59 +02:00
|
|
|
assertRelativeDateMs(new Date(2099, 12), 4102444800000);
|
2014-07-22 01:09:02 +02:00
|
|
|
|
2016-04-19 23:00:59 +02:00
|
|
|
assertRelativeDateMs(new Date(2100, 0), 4102444800000);
|