Back to browse
GitHub Repository

A Cloudflare Worker that serves subscribable iCal calendar feeds for astronomical events.

2 starsTypeScript

Subscribable calendar feeds for astronomical events

by gardnr·Feb 22, 2026·1 point·0 comments

AI Analysis

●●SolidCozyNiche Gem

iCal feeds for sunrise/sunset and lunar phases—elegant, zero friction, works in any calendar.

Strengths
  • Precise algorithms: Meeus polynomial for solstices (±5–15 min), sub-millisecond binary search for moon phases
  • Deployable on free Cloudflare Workers tier, reference instance live and usable today
Weaknesses
  • Niche use case; calendar integration is expected, not novel
  • Timezone approximation (lon/15) is lossy during DST—acknowledged limitation but still a rough edge
Category
Target Audience

Astronomy enthusiasts, photographers, outdoor planners, Google Calendar users

Similar To

Google Calendar built-in events · Lunar Calendar apps · TimeAndDate.com API

Post Description

I wanted sunrise and sunset times in Google Calendar so I would know when it's a good time to go out and take a walk. These are all pretty straight-forward calculations that can happen given the lat / long. I created a simple CF workers API that you can paste into "Add other calendars" in the "From URL" action.

You can deploy your own instance using the code at https://github.com/gardner/sunlight

Or, use the reference instance by adding https://cal.sunlight.nz/api/sunrise?lat=-41.27&lon=173.28 (You'll need to use your own lat long)

There is also a calendar that focuses on global events that don't require a lat long. This includes things like lunar phase, equinox, solstice, and cross-quarter days: https://cal.sunlight.nz/api/celestial

Similar Projects