From 439ca32e09775fbb3ee47034a35a62aa2a2dee79 Mon Sep 17 00:00:00 2001 From: Dave C-J Date: Sat, 1 Feb 2014 18:02:27 +0000 Subject: [PATCH] Tweak sunrise node to use UTC for all calculations... --- time/79-suncalc.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/time/79-suncalc.js b/time/79-suncalc.js index 8004633d..2c5e8b54 100644 --- a/time/79-suncalc.js +++ b/time/79-suncalc.js @@ -29,13 +29,13 @@ function SunNode(n) { this.tick = setInterval(function() { var now = new Date(); - var hour = now.getHours(); - var mins = now.getMinutes(); + var hour = now.getUTCHours(); + var mins = now.getUTCMinutes(); var times = SunCalc.getTimes(now, node.lat, node.lon); - var hour1 = times[node.start].getHours(); - var mins1 = times[node.start].getMinutes(); - var hour2 = times[node.end].getHours(); - var mins2 = times[node.end].getMinutes(); + var hour1 = times[node.start].getUTCHours(); + var mins1 = times[node.start].getUTCMinutes(); + var hour2 = times[node.end].getUTCHours(); + 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;