sixths: only display times when set/rise is close

pull/3615/head
Pavel Machek 2024-10-13 21:07:48 +02:00
parent b12cb9ff8b
commit 8c78f552df
1 changed files with 4 additions and 1 deletions

View File

@ -224,7 +224,10 @@ let sun = {
let t = this.sunTime(); let t = this.sunTime();
this.rise = t.sunrise.getTime() / 1000; this.rise = t.sunrise.getTime() / 1000;
this.set = t.sunset.getTime() / 1000; this.set = t.sunset.getTime() / 1000;
return;
} }
this.rise = getTime() - 4*3600;
this.set = getTime() + 4*3600;
}, },
// < 0 : next is sunrise, in abs(ret) seconds // < 0 : next is sunrise, in abs(ret) seconds
// > 0 // > 0
@ -859,7 +862,7 @@ function draw() {
{ {
let set = sun.getNext(); let set = sun.getNext();
if (true || (set > -8*60*60 && set < 2*60*60)) { if ((set > -12*60*60 && set < 4*60*60)) {
if (set < 0) { if (set < 0) {
msg += "^"; msg += "^";
set = -set; set = -set;