Module:Aired

-- code by Kocka; Dev Wiki local p = {} local Date = require('Dev:Date') local colors = require('Dev:Colors')

function p.main(frame) local page_name = frame.args[1] local aired_date_string = frame.args[2] if type(aired_date_string) == 'string' and aired_date_string ~= '' then local current_date = Date local year_only = mw.ustring.match(aired_date_string, "^%d%d%d%d$") local aired_date = year_only and aired_date_string or Date(aired_date_string) if year_only then return aired_date_string .. '|| Somewhen in that year ' elseif aired_date < current_date then return table.concat({aired_date_string, '|| Aired '}) else return table.concat({aired_date_string, '|| Not aired — Date confirmed '}) end else return 'Unknown || Pre-Release ' end end return p