BigTimer and getMoonTimes

I just spent ages debugging issue with theSunCalc module used in Node-Red-Contrib--BigTimer.

It turns out that the getMoonTimes module doesn’t seem to handle the alwaysUp and alwaysDown methods the way one might expected – these do not return FALSE  if not TRUE – they return undefined – that took some figuring out.

I started with try-catch but that failed also. Simply checking as follows did the trick:

if (typeof moons.rise==='undefined')
moonrise=1440;
else
{
date2=moons.rise; moonrise = (date2.getHours() * 60) +
date2.getMinutes();
}              

if (typeof moons.set==='undefined')
moonset=0;
else
{
date3=moons.set; moonset = (date3.getHours() * 60) +
date3.getMinutes();
}           

I’m pretty sure this is now fixed as of BigTimer 2.1.7

Thanks to Aidan Ruff for his help in this one.

Facebooktwittergoogle_pluspinterestlinkedin

6 thoughts on “BigTimer and getMoonTimes

Leave a Reply

Your e-mail address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.