Sun and Moon calculator

Items that go good with weather are Sun and Moon data. I found a great JavaScript library that calculates the Sun and Moon phase data for display in your application.

I’ve been using it for a couple of months and it’s as accurate as I can find.


© 2011-2015, Vladimir Agafonkin
SunCalc is a JavaScript library for calculating sun/moon position and light phases.
// sun calculations are based on formulas
// moon calculations, based on formulas
// calculations for moon rise/set times are based on article
// calculations for illumination parameters of the moon,
// based on formulas and
// Chapter 48 of “Astronomical Algorithms” 2nd edition by Jean Meeus (Willmann-Bell, Richmond) 1998.