Hacker News new | ask | show | jobs
by mourner 106 days ago
Author of suncalc (the JS library behind the sun calculations) here — happy to see such a nice application of it! Heads up if the author's reading this — I recently released a major overhaul of the library that makes it a lot more precise: https://github.com/mourner/suncalc
4 comments

I just used Suncalc yesterday to add Sunrise/Sunset and Golden Hour to my PebbleOS NOAA Radar watchface[1]. Thank you for an amazing library; It's the first that I reach for every time I have a project with this need.

1. https://apps.repebble.com/2029ab9c84f946e1b125f8e0

Author of Sun Clock here — thanks for the library! I'll check out the new release soon and update.
It would be nice if I could just put a postal code in
Dumb question, but what does the green hand denote?
The green hand is the minutes hand.
I am working on a clock app that keeps time the Roman Empire way (every day has twelve hours that start at sunrise and end at sunset, so the duration of each hour changes slightly each day), so this library would be extremely helpful. Thank you!
what sorts of background texts/sources of info did you use?

edit: i think i have the dover book your readme mentions :)

Initially (about 15 years ago - it was my first ever open source library!) it was based on Astronomy Answers articles that are thankfully still live at https://www.aa.quae.nl/en/reken/zonpositie.html, but v2.0 specifically was rewritten to use the approach described in Jean Meeus' Astronomical Algorithms book.
I did a similar one recently but have not been able to validate it's calculations against any other source. Thanks for posting the link to yours when I get time I'll compare and see if they match up. https://git.mikedilger.com/mikedilger/sunangle