mirror of
https://github.com/node-red/node-red-nodes.git
synced 2023-10-10 13:36:58 +02:00
Tweak sunrise node to use UTC for all calculations...
This commit is contained in:
parent
2dbd93d63d
commit
439ca32e09
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user