From a115c3f86254fe098d2b2dddf0f1a46003d8bc30 Mon Sep 17 00:00:00 2001 From: Gordon Williams Date: Fri, 9 Dec 2022 13:19:07 +0000 Subject: [PATCH] Change 3rd mode to show the next sunrise/sunset time (not actual time) --- apps/clkinfosunrise/ChangeLog | 1 + apps/clkinfosunrise/clkinfo.js | 4 ++-- apps/clkinfosunrise/metadata.json | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/apps/clkinfosunrise/ChangeLog b/apps/clkinfosunrise/ChangeLog index 9854c6b53..d50fb06f4 100644 --- a/apps/clkinfosunrise/ChangeLog +++ b/apps/clkinfosunrise/ChangeLog @@ -1,3 +1,4 @@ 0.01: New App! 0.02: Use 'modules/suncalc.js' to avoid it being copied 8 times for different apps Add a 'time' clockinfo that also displays a percentage of day left +0.03: Change 3rd mode to show the next sunrise/sunset time (not actual time) diff --git a/apps/clkinfosunrise/clkinfo.js b/apps/clkinfosunrise/clkinfo.js index b31cc22ba..71031e1d5 100644 --- a/apps/clkinfosunrise/clkinfo.js +++ b/apps/clkinfosunrise/clkinfo.js @@ -42,7 +42,7 @@ return { text : locale.time(sunset,1), img : atob("GBiBAAAAAAAAAAAAAAB+AAA8AAAYAAAYAAAAAAAAAAAAAAAYAAAYAAQYIA4AcAYAYAA8AAB+AAD/AAH/gD///D///AAAAAAAAAAAAA==") }}, show : show, hide : hide - }, { name : "Time", // Time in day (uses v/min/max to show percentage through day) + }, { name : "Sunrise/set", // Time in day (uses v/min/max to show percentage through day) hasRange : true, get : () => { calculate(); @@ -59,7 +59,7 @@ } else { // day! v = Math.round(100 * (d-sunrise.getTime()) / dayLength); } - return { text : locale.time(date,1), v : v, min : 0, max : 100, + return { text : locale.time(day ? sunset.getTime() : sunrise.getTime(),1), v : v, min : 0, max : 100, img : day ? atob("GBiBAAAYAAAYAAAYAAgAEBwAOAx+MAD/AAH/gAP/wAf/4Af/4Of/5+f/5wf/4Af/4AP/wAH/gAD/AAx+MBwAOAgAEAAYAAAYAAAYAA==") : atob("GBiBAAfwAA/8AAP/AAH/gAD/wAB/wAB/4AA/8AA/8AA/8AAf8AAf8AAf8AAf8AA/8AA/8AA/4AB/4AB/wAD/wAH/gAf/AA/8AAfwAA==") } }, diff --git a/apps/clkinfosunrise/metadata.json b/apps/clkinfosunrise/metadata.json index 74877c523..d130c6453 100644 --- a/apps/clkinfosunrise/metadata.json +++ b/apps/clkinfosunrise/metadata.json @@ -1,6 +1,6 @@ { "id": "clkinfosunrise", "name": "Sunrise Clockinfo", - "version":"0.02", + "version":"0.03", "description": "For clocks that display 'clockinfo' (messages that can be cycled through using the clock_info module) this displays sunrise and sunset based on the location from the 'My Location' app", "icon": "app.png", "type": "clkinfo",