642
回編集
template>Rxy (en:Module:Effective protection expiry 2015年12月13日 (日) 20:15 UTC の版より全文転記) |
Triple-Zeta (トーク | 投稿記録) 細 (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( ' | 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 = | local year, month, day, hour, minute, second = rawExpiry:match( | ||
'^(%d%d%d%d)(%d%d)(%d%d)(%d%d)(%d%d)(%d%d)$' | |||
) | |||
return | 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 |