UNPKG
lune
Version:
latest (0.4.0)
0.4.0
0.3.0
0.2.1
0.2.0
0.1.0
0.0.2
0.0.1
Calculate the phases of the moon
github.com/ryanseys/lune
ryanseys/lune
lune
/
lib
/
julian.js
13 lines
(9 loc)
•
224 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
13
'use strict'
function
fromDate
(
date
) {
return
date.
getTime
() /
86400000
+
2440587.5
}
function
toDate
(
julian
) {
return
new
Date
((julian -
2440587.5
) *
86400000
) }
exports
.
fromDate
= fromDate
exports
.
toDate
= toDate