committed 05:32PM - 09 Jul 26 UTC
v2 is a precision-focused rewrite (Meeus algorithms, ~5-20x better
accuracy). It…s breaking changes (degrees instead of radians, north-
based azimuth, apparent altitude) only affect getPosition/
getMoonPosition/getMoonIllumination -- Meteogram.vue only calls
getTimes(), which is unaffected apart from one relevant change:
missing sun events are now `null` instead of `Invalid Date`.
That change fixes a real, currently-live bug: verified with suncalc@1
side-by-side that `times.sunrise` is an `Invalid Date` object (truthy,
not caught by `??`) for polar-day/polar-night latitudes, so
`sunrise.toISOString()` throws `RangeError: Invalid time value`.
v2 returns `null` instead, which the existing `??` fallback chain
already handles correctly.
Also dropped `@types/suncalc` (v2 ships its own bundled
TypeScript declarations) and replaced the `as any` escape hatch in
Meteogram.vue with the real `SunTimes` type now that it's available.
Verified: typecheck, lint, all 115 unit tests, and a production build
all pass. Also drove a real browser against the live backend for
station 01001 (Jan Mayen, 70.93degN) during actual polar-day
conditions -- the meteogram renders correctly with day-shading
spanning nearly the full 24h per day, zero console errors, confirming
the fix.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>