mirror of
https://github.com/RGBCube/serenity
synced 2025-07-23 19:07:34 +00:00
![]() Year computation has to be based on seconds, not days, in case t is < 0 but t / __seconds_per_day is 0. Year computation also has to consider negative timestamps. With this, days is always positive and <= the number of days in the year, so base the tm_wday computation directly on the timestamp, and do it first, before t is modified in the year computation. In C, % can return a negative number if the left operand is negative, compensate for that. Tested via test-js. (Except for tm_wday, since we don't implement Date.prototype.getUTCDate() yet.) |
||
---|---|---|
.. | ||
Date.js | ||
Date.now.js | ||
Date.parse.js | ||
Date.prototype.getDate.js | ||
Date.prototype.getDay.js | ||
Date.prototype.getFullYear.js | ||
Date.prototype.getHours.js | ||
Date.prototype.getMilliseconds.js | ||
Date.prototype.getMinutes.js | ||
Date.prototype.getMonth.js | ||
Date.prototype.getSeconds.js | ||
Date.prototype.getTime.js | ||
Date.prototype.toISOString.js | ||
Date.UTC.js |