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 | ||
return 'infinity' | |||
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 | |||
end | |||
end | end | ||