UNPKG
@kalender/core
Version:
latest (0.3.3-alpha.4)
0.3.3-alpha.4
0.3.3-alpha.3
0.3.3-alpha.2
0.3.3-alpha.1
0.3.3-alpha.0
0.3.2-alpha.3
0.3.2-alpha.2
0.3.2-alpha.1
0.3.2-alpha.0
0.3.1-alpha.4
0.3.1-alpha.3
0.3.1-alpha.2
0.3.1-alpha.1
0.3.1-alpha.0
0.3.0-alpha.0
0.2.3
0.2.2
0.2.1
0.2.0
0.1.3
0.1.2
0.1.1
calendar core library
github.com/ztytotoro/kalender
ztytotoro/kalender
@kalender/core
/
src
/
date-tools
/
year.ts
9 lines
(6 loc)
•
229 B
text/typescript
View Raw
1
2
3
4
5
6
7
8
9
import
{ normalDate }
from
'./date'
;
export
function
daysOfYear
(
year: number
) {
const
start =
normalDate
(year,
1
,
1
);
const
end =
normalDate
(year +
1
,
1
,
1
);
return
(end.
valueOf
() - start.
valueOf
()) /
1000
/
3600
/
24
; }