From 6b9c955dc580bf71abcaebd6869bc006f02b2f11 Mon Sep 17 00:00:00 2001 From: paul-arg Date: Sat, 8 Jun 2024 17:54:19 +0200 Subject: [PATCH] fix(astrocalc): handle when the moon rise or set don't occur on the current day --- apps/astrocalc/astrocalc-app.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/astrocalc/astrocalc-app.js b/apps/astrocalc/astrocalc-app.js index cd1965290..02bcefc43 100644 --- a/apps/astrocalc/astrocalc-app.js +++ b/apps/astrocalc/astrocalc-app.js @@ -180,8 +180,8 @@ function drawMoonTimesPage(gps, title) { const moonColor = g.theme.dark ? {r: 1, g: 1, b: 1} : {r: 0, g: 0, b: 0}; const pageData = { - Rise: dateToTimeString(times.rise), - Set: dateToTimeString(times.set), + Rise: times.rise ? dateToTimeString(times.rise) : "Not today", + Set: times.set ? dateToTimeString(times.set) : "Not today", }; drawData(title, pageData, null, g.getHeight()/2 - Object.keys(pageData).length/2*20 + 5);