편집을 취소할 수 있습니다. 이 편집을 되돌리려면 아래의 바뀐 내용을 확인한 후 게시해주세요.
최신판 | 당신의 편집 | ||
18번째 줄: | 18번째 줄: | ||
local timeText = { | local timeText = { | ||
['seconds'] = 1, | ['seconds'] = 1, | ||
['minutes'] = 60, | ['minutes'] = 60, | ||
['hours'] = 3600, | ['hours'] = 3600, | ||
['days'] = 86400, | ['days'] = 86400, | ||
['weeks'] = 604800, | ['weeks'] = 604800, | ||
['months'] = 2629800, -- 365.25 * 24 * 60 * 60 / 12 | ['months'] = 2629800, -- 365.25 * 24 * 60 * 60 / 12 | ||
['years'] = 31557600 | |||
['years | |||
} | } | ||
41번째 줄: | 32번째 줄: | ||
[3600] = { '시간', '시간', "시간", "시간" }, | [3600] = { '시간', '시간', "시간", "시간" }, | ||
[86400] = { '일', '일', "일", "일" }, | [86400] = { '일', '일', "일", "일" }, | ||
[604800] = { '주', '주', "주", "주" }, | [604800] = { '주', '주', "주", "주", unit = 'w' }, | ||
[2629800] = { '개월', '개월', "개월", "개월" }, | [2629800] = { '개월', '개월', "개월", "개월", unit = 'm' }, | ||
[31557600] = { '년', '년', "년", "년" } | [31557600] = { '년', '년', "년", "년", unit = 'y' } | ||
} | } | ||
57번째 줄: | 48번째 줄: | ||
-- Add a purge link if something (usually "yes") is entered into the purge parameter | -- Add a purge link if something (usually "yes") is entered into the purge parameter | ||
if purge then | if purge then | ||
purge = ' <span class="plainlinks">([' .. mw.title.getCurrentTitle():fullUrl('action=purge') .. ' | purge = ' <span class="plainlinks">([' .. mw.title.getCurrentTitle():fullUrl('action=purge') .. ' purge])</span>' | ||
else | else | ||
purge = '' | purge = '' | ||
65번째 줄: | 56번째 줄: | ||
local success, inputTime = pcall( lang.formatDate, lang, 'xnU', args[1] ) | local success, inputTime = pcall( lang.formatDate, lang, 'xnU', args[1] ) | ||
if not success then | if not success then | ||
return '<strong class="error"> | return '<strong class="error">Error: first parameter cannot be parsed as a date or time.</strong>' | ||
end | end | ||
136번째 줄: | 127번째 줄: | ||
else -- Future | else -- Future | ||
if args.ago == '' then | if args.ago == '' then | ||
suffix = ' | suffix = '' | ||
if result_num == 1 then | if result_num == 1 then | ||
punctuation_key = 1 | punctuation_key = 1 | ||
143번째 줄: | 134번째 줄: | ||
end | end | ||
else | else | ||
suffix = ' | suffix = ' time' | ||
if result_num == 1 then | if result_num == 1 then | ||
punctuation_key = 3 | punctuation_key = 3 | ||
167번째 줄: | 158번째 줄: | ||
end | end | ||
local result = result_num_text .. '' .. result_unit .. suffix -- Spaces for suffix have been added in earlier. | local result = result_num_text .. ' ' .. result_unit .. suffix -- Spaces for suffix have been added in earlier. | ||
return result .. purge | return result .. purge | ||
end | end |