From b9361f5e657bca20c6ef3b19232ec1e65b798601 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 8 Jan 2024 21:45:58 +0100 Subject: [PATCH] glcd/weather: use next day after 4pm; align display to lcd4linux Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/8fee8bd7c742eb11a2958222e670bef15eef8631 Author: vanhofen Date: 2024-01-08 (Mon, 08 Jan 2024) Origin message was: ------------------ - glcd/weather: use next day after 4pm; align display to lcd4linux ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/driver/glcd/weather.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/driver/glcd/weather.cpp b/src/driver/glcd/weather.cpp index 049125d3d..f4fb85e57 100644 --- a/src/driver/glcd/weather.cpp +++ b/src/driver/glcd/weather.cpp @@ -105,7 +105,11 @@ void RenderWeather(bool standby) y = t.glcd_standby_weather_y_position; } - int forecast = 0; // 0 is current day + time_t _n = time(NULL); + struct tm *_t; + _t = localtime(&_n); + + int forecast = _t->tm_hour < 16 ? 0 : 1; // 0 is current day; after 4pm use next day std::string current_wcity = ""; std::string current_wtimestamp = "";