Module:Episode list: Difference between revisions

Content deleted Content added
Per talk page request
Tag: Reverted
Undid revision 1112400418 by Alex 21 (talk) Per talk page request
Line 180:
-- with either "TBD" or "N/A".
-- Set to N/A if viewers haven't been available for four weeks, else set it as TBD.
local function setTBDStatus(args, awaitingText, expiredText, weeks)
local month, day, year = args.OriginalAirDate:gsub(" ", " "):match("(%a+) (%d+), (%d+)")
 
Line 212:
local seconds = os.time() - os.time({year = year, month = monthList[month], day = day, hour = 0, min = 0, sec = 0})
 
if (seconds >= 60 * 60 * 24 * 7 * weeks4) then
return tableEmptyCellModule._main({alt_text = expiredText, title_text = expiredText"N/A"})
else
return tableEmptyCellModule._main({alt_text = awaitingText, title_text = awaitingText"TBD"})
end
end
Line 225:
args[v] = tableEmptyCellModule._main({alt_text = "N/A"})
elseif (v == 'Viewers' and hasValue(args.OriginalAirDate)) then
args[v] = setTBDStatus(args, "TBD", "N/A", 4)
elseif (v == 'DirectedBy' or v == 'WrittenBy') then
args[v] = setTBDStatus(args, "TBA", "Unknown", 4)
else
args[v] = tableEmptyCellModule._main({})