Module:Effective protection expiry/sandbox: Difference between revisions

Content deleted Content added
make this more robust
make the whitespace consistent
Line 16:
return 'unknown'
elseif action ~= 'edit' and action ~= 'move' and action ~= 'create' and action ~= 'upload' then
error( 'First parameter must be one of edit, move, create, upload, autoreview', 2 )
end
local rawExpiry = mw.getCurrentFrame():callParserFunction('PROTECTIONEXPIRY', action, pagename)
Line 22:
return 'infinity'
elseif tonumber(rawExpiry) then
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
Line 35:
return t._main(k, frame.args[1])
end
end })
 
return p