aswi2020vldc-gitlab/templetes/node_modules/es-abstract/2017/DaysInYear.js @ 4605a44b
1 | 3a515b92 | cagy | 'use strict'; |
---|---|---|---|
2 | |||
3 | var mod = require('../helpers/mod'); |
||
4 | |||
5 | // https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3
|
||
6 | |||
7 | module.exports = function DaysInYear(y) { |
||
8 | if (mod(y, 4) !== 0) { |
||
9 | return 365; |
||
10 | }
|
||
11 | if (mod(y, 100) !== 0) { |
||
12 | return 366; |
||
13 | }
|
||
14 | if (mod(y, 400) !== 0) { |
||
15 | return 365; |
||
16 | }
|
||
17 | return 366; |
||
18 | };
|