You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

DaysInYear.js 300B

123456789101112131415161718
  1. 'use strict';
  2. var mod = require('../helpers/mod');
  3. // https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3
  4. module.exports = function DaysInYear(y) {
  5. if (mod(y, 4) !== 0) {
  6. return 365;
  7. }
  8. if (mod(y, 100) !== 0) {
  9. return 366;
  10. }
  11. if (mod(y, 400) !== 0) {
  12. return 365;
  13. }
  14. return 366;
  15. };