modified: widgets/weather.lua - fixed +- 1 day difference due

to UTC time
This commit is contained in:
Trap000d 2016-05-29 11:15:07 +12:00
parent e6e0889fb2
commit e3a5dd6237
1 changed files with 2 additions and 0 deletions

View File

@ -128,11 +128,13 @@ local function worker(args)
current_dt = os.time() current_dt = os.time()
sunrise = weather_now["sys"]["sunrise"] sunrise = weather_now["sys"]["sunrise"]
sunset = weather_now["sys"]["sunset"] 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 if current_dt > sunrise and current_dt < sunset then
datetime="d" datetime="d"
else else
datetime="n" datetime="n"
end end
-- error("dt sr:" .. sunrise .. "ss: " .. sunset .. "dt: " .. current_dt .. "d/n: " .. datetime .. "hehe")
icon = weather_now["weather"][1]["icon"] icon = weather_now["weather"][1]["icon"]
weather.icon_path = icons_path .. icon:sub(1,2) .. datetime .. ".png" weather.icon_path = icons_path .. icon:sub(1,2) .. datetime .. ".png"
widget = weather.widget widget = weather.widget