Module:Effective protection expiry: Difference between revisions
Jump to navigation
Jump to search
Content added Content deleted
(handles special pages) |
(return a yyyy-mm-ddThh:mm:ss timestamp, rather than just yyyy-mm-dd) |
||
Line 24: | Line 24: | ||
return 'unknown' |
return 'unknown' |
||
else |
else |
||
local year |
local year, month, day, hour, minute, second = rawExpiry:match( |
||
'^(%d%d%d%d)(%d%d)(%d%d)(%d%d)(%d%d)(%d%d)$' |
|||
local month = mw.ustring.sub( rawExpiry, 5, 6 ) |
|||
) |
|||
local day = mw.ustring.sub( rawExpiry, 7, 8 ) |
|||
if year then |
|||
return year .. '-' .. month .. '-' .. day |
|||
return string.format( |
|||
'%s-%s-%sT%s:%s:%s', |
|||
year, month, day, hour, minute, second |
|||
) |
|||
else |
|||
error('internal error in Module:Effective protection expiry; malformed expiry timestamp') |
|||
end |
|||
end |
end |
||
end |
end |