From: copycat-killer Date: Tue, 7 Feb 2017 08:07:09 +0000 (+0100) Subject: Merge branch 'master' of https://github.com/trap000d/lain into trap000d-master X-Git-Url: https://git.madduck.net/etc/awesome.git/commitdiff_plain/6a3294bd7341e60be917aafbcb14f2dc416fae9d?hp=e46fa5a6df6474f430c40de5a2da1081731dea07 Merge branch 'master' of https://github.com/trap000d/lain into trap000d-master --- diff --git a/widgets/weather.lua b/widgets/weather.lua index 1e398cc..9e1b80e 100644 --- a/widgets/weather.lua +++ b/widgets/weather.lua @@ -130,7 +130,13 @@ local function worker(args) local icon = weather_now["weather"][1]["icon"] local loc_m = os.time { year = os.date("%Y"), month = os.date("%m"), day = os.date("%d"), hour = 0 } local offset = utc_offset() - local utc_m = loc_m + offset + local utc_m = loc_m - offset + + if offset > 0 and (now - utc_m)>=86400 then + utc_m = utc_m + 86400 + elseif offset < 0 and (utc_m - now)>=86400 then + utc_m = utc_m - 86400 + end -- if we are 1 day after the GMT, return 1 day back, and viceversa if offset > 0 and loc_m >= utc_m then