「モジュール:Effective protection expiry」の版間の差分

2版 をインポートしました
template>Rxy
(en:Module:Effective protection expiry 2015年12月13日 (日) 20:15‎ UTC の版より全文転記)
 
(2版 をインポートしました)
 
(4人の利用者による、間の8版が非表示)
14行目: 14行目:
pagename = title.prefixedText
pagename = title.prefixedText
if action == 'autoreview' then
if action == 'autoreview' then
return 'unknown'
local stabilitySettings = mw.ext.FlaggedRevs.getStabilitySettings(title)
return stabilitySettings and stabilitySettings.expiry or 'unknown'
elseif action ~= 'edit' and action ~= 'move' and action ~= 'create' and action ~= 'upload' then
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 )
error( '第1引数にはedit、move、create、upload、autoreviewのどれかを指定してください', 2 )
end
end
local rawExpiry = mw.getCurrentFrame():callParserFunction('PROTECTIONEXPIRY', action, pagename)
local rawExpiry = mw.getCurrentFrame():callParserFunction('PROTECTIONEXPIRY', action, pagename)
24行目: 25行目:
return 'unknown'
return 'unknown'
else
else
local year = mw.ustring.sub( rawExpiry, 1, 4 )
local year, month, day, hour, minute, second = rawExpiry:match(
local month = mw.ustring.sub( rawExpiry, 5, 6 )
'^(%d%d%d%d)(%d%d)(%d%d)(%d%d)(%d%d)(%d%d)$'
local day = mw.ustring.sub( rawExpiry, 7, 8 )
)
return year .. '-' .. month .. '-' .. day
if year then
return string.format(
'%s-%s-%sT%s:%s:%s',
year, month, day, hour, minute, second
)
else
error('[[モジュール:Effective protection expiry]]のエラー; 有効期限のタイムスタンプの書式が不正です')
end
end
end
end
end