From: Trap000d Date: Sat, 28 May 2016 23:15:07 +0000 (+1200) Subject: modified: widgets/weather.lua - fixed +- 1 day difference due X-Git-Url: https://git.madduck.net/etc/awesome.git/commitdiff_plain/e3a5dd623700b2cad423c8179141124e6e9b9027?ds=sidebyside;hp=-c modified: widgets/weather.lua - fixed +- 1 day difference due to UTC time --- e3a5dd623700b2cad423c8179141124e6e9b9027 diff --git a/widgets/weather.lua b/widgets/weather.lua index cd8f6ab..df34040 100644 --- a/widgets/weather.lua +++ b/widgets/weather.lua @@ -128,11 +128,13 @@ local function worker(args) current_dt = os.time() sunrise = weather_now["sys"]["sunrise"] sunset = weather_now["sys"]["sunset"] + if current_dt> sunrise and current_dt> sunset then current_dt = current_dt - 86400 end if current_dt > sunrise and current_dt < sunset then datetime="d" else datetime="n" end + -- error("dt sr:" .. sunrise .. "ss: " .. sunset .. "dt: " .. current_dt .. "d/n: " .. datetime .. "hehe") icon = weather_now["weather"][1]["icon"] weather.icon_path = icons_path .. icon:sub(1,2) .. datetime .. ".png" widget = weather.widget