Module:Effective protection expiry/sandbox: Difference between revisions

Content deleted Content added
Create sandbox version of Module:Effective protection expiry
 
make this more robust
Line 21:
if rawExpiry == 'infinity' then
return 'infinity'
elseif tonumber(rawExpiry == '') then
return 'unknown'
else
local year = mw.ustring.sub( rawExpiry, 1, 4 )
local month = mw.ustring.sub( rawExpiry, 5, 6 )
local day = mw.ustring.sub( rawExpiry, 7, 8 )
return year .. '-' .. month .. '-' .. day
else
return 'unknown'
end
end