From fdeb0ba71c1d223e1e95a913880ba89df27d33b4 Mon Sep 17 00:00:00 2001 From: John Cooper Date: Sun, 16 Mar 2014 20:44:41 +0000 Subject: [PATCH] Update suncalc for new moonIllumination code. The Node Suncal library has changed the moon function name this changes the code to cope with it. In this commit to suncalc. https://github.com/mourner/suncalc/commit/bf5ee6377e8b829974046d02389d7bd05ee4d95f So now this causes node to crash. --- time/79-suncalc.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/time/79-suncalc.js b/time/79-suncalc.js index 2c5e8b54..2b265391 100644 --- a/time/79-suncalc.js +++ b/time/79-suncalc.js @@ -38,7 +38,7 @@ function SunNode(n) { var mins2 = times[node.end].getUTCMinutes(); var e1 = (hour*60+mins) - (hour1*60+mins1); var e2 = (hour*60+mins) - (hour2*60+mins2); - var moon = parseInt(SunCalc.getMoonFraction(now)*100)/100; + var moon = SunCalc.getMoonIllumination(now).fraction; msg = { payload:0, topic:"sun", moon:moon }; if ((e1 > 0) & (e2 < 0)) { msg.payload = 1; } if (oldval == null) { oldval = msg.payload; }