I'm not a fan of the brute force +1 on the Calc measure myself.
Since the "time" of the show is undefined, you might change the Lua to use:
Code: Select all
function GetDays(month, day, year, measureName)
local showTime = os.time({year=year, month=month, day=day, hour=23, min=59, sec=59, isdst=false})
local nowTime = os.time(os.date('!*t'))
local daysDiff = math.floor((showTime - nowTime ) / 86400)
SKIN:Bang('!SetOption', measureName, 'Formula', math.abs(daysDiff))
end
Another thing you might try is to test against your local time, rather than against GMT.
local nowTime = os.time(os.date('*t'))
That might give a better sense of things as observed by you in your location. Now that I chew on it a bit, I think that makes more sense, since the time of the show is undefined, and this might be better relative to your local time.