Module:Effective protection expiry: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 19: Line 19:
end
end
local rawExpiry = mw.getCurrentFrame():callParserFunction('PROTECTIONEXPIRY', action, pagename)
local rawExpiry = mw.getCurrentFrame():callParserFunction('PROTECTIONEXPIRY', action, pagename)
local year = mw.ustring.sub( rawExpiry, 1, 4 )
if rawExpiry == 'infinity' then
local month = mw.ustring.sub( rawExpiry, 5, 6 )
return 'infinity'
local day = mw.ustring.sub( rawExpiry, 7, 8 )
else
return year .. '-' .. month .. '-' .. day
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
end
end
end


Anonymous user