Function: getYearOfDay

getYearOfDay(time): number

获取某年有多少天

Parameters

Name Type Description
time string | Date 年份字符串或Date对象

Returns

number

返回该年的天数

Since

1.2.4

Throws

当time参数不是字符串或Date对象时抛出

Example

getYearOfDay('2014');
// => 365

getYearOfDay(new Date('2020-01-01'));
// => 366

getYearOfDay('2024');
// => 366
ON THIS PAGE