diff --git a/apps/solarclock/solar_clock.js b/apps/solarclock/solar_clock.js index 24244cfc6..924090f6e 100644 --- a/apps/solarclock/solar_clock.js +++ b/apps/solarclock/solar_clock.js @@ -350,7 +350,7 @@ location.addUpdateListener( // The function also has to detect when the end of the solar // day has been reached and flip the day over. function dayInfo(now) { - if (day_info == null || now > day_info.day_end) { + if (day_info == null || now > day_info.day_end || now < day_info.day_start) { var coords = location.getCoordinates(); if(coords != null) { day_info = DateUtils.sunrise_sunset(now, coords[0], coords[1], location.getUTCOffset()); diff --git a/apps/solarclock/solar_controller.js b/apps/solarclock/solar_controller.js index 5908b82ef..dd26d89e3 100644 --- a/apps/solarclock/solar_controller.js +++ b/apps/solarclock/solar_controller.js @@ -121,7 +121,6 @@ class SolarMode { } } class NightMode extends SolarMode { - toString(){return "NightMode";} test(time, day_info, screen_info, img_info) { return (time < day_info.sunrise_date || time > day_info.sunset_date); } @@ -130,9 +129,6 @@ class NightMode extends SolarMode { } } class DayLightMode extends SolarMode { - toString(){ - return "DayLightMode"; - } test(time, day_info, screen_info){ var sun_height = screen_info.sunrise_y - screen_info.sun_y; /*console.log("DayLightMode " + @@ -190,9 +186,6 @@ class DayLightMode extends SolarMode { } } class TwiLightMode extends SolarMode { - toString(){ - return "TwilightMode"; - } test(time, day_info, screen_info){ if(screen_info.sunrise_y == null) { console.log("warning no sunrise_defined"); @@ -233,9 +226,6 @@ class SolarControllerImpl { this.default_mode = new NightMode(); this.last = null; } - toString(){ - return "SolarControllerImpl"; - } // The mode method is responsible for selecting the // correct mode to the time given. mode(time, day_info, screen_info){