Skip to content

Commit 6265a91

Browse files
committed
Update README
1 parent b080eb9 commit 6265a91

1 file changed

Lines changed: 26 additions & 0 deletions

File tree

README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,32 @@ Lunar phases, in order:
3333
| Last Quarter | 🌗 | 🌓 |
3434
| Waning Crescent | 🌘 | 🌒 |
3535

36+
## Julian Day
37+
38+
Convert to and from Gregorian Dates to Julian Days via the `JulianDay` module.
39+
40+
To convert a date to Julian Day:
41+
42+
```js
43+
import { JulianDay } from "lunarphase-js";
44+
45+
const date = new Date();
46+
const julian = JulianDay.fromDate(date);
47+
```
48+
49+
To convert a Julian Day to a date:
50+
51+
```js
52+
import { JulianDay } from "lunarphase-js";
53+
54+
const julian = 2459356.529302257;
55+
const date = JulianDay.toDate(julian);
56+
```
57+
58+
59+
## Lunar Phases
60+
61+
3662
For a specific date, pass a date object to a function
3763

3864
```js

0 commit comments

Comments
 (0)