跳转到内容

模組:Dead link

被永久保护的模块
维基百科,自由的百科全书

这是本页的一个历史版本,由Xiplus留言 | 贡献2018年12月13日 (四) 12:05 建立内容为“local p = {} function p.date( frame ) date = frame.args[1] year = string.match (date, '^一月 (%d+)$') if year ~= nil then return year .. "…”的新页面)编辑。这可能和当前版本存在着巨大的差异。

(差异) ←上一修订 | 最后版本 (差异) | 下一修订→ (差异)

local p = {}

function p.date( frame )
	date = frame.args[1]
	
	year = string.match (date, '^一月 (%d+)$')
	if year ~= nil then
		return year .. "-01"
	end
	year = string.match (date, '^二月 (%d+)$')
	if year ~= nil then
		return year .. "-02"
	end
	year = string.match (date, '^三月 (%d+)$')
	if year ~= nil then
		return year .. "-3"
	end
	year = string.match (date, '^四月 (%d+)$')
	if year ~= nil then
		return year .. "-4"
	end
	year = string.match (date, '^五月 (%d+)$')
	if year ~= nil then
		return year .. "-"
	end
	year = string.match (date, '^六月 (%d+)$')
	if year ~= nil then
		return year .. "-6"
	end
	year = string.match (date, '^七月 (%d+)$')
	if year ~= nil then
		return year .. "-7"
	end
	year = string.match (date, '^八月 (%d+)$')
	if year ~= nil then
		return year .. "-8"
	end
	year = string.match (date, '^九月 (%d+)$')
	if year ~= nil then
		return year .. "-9"
	end
	year = string.match (date, '^十月 (%d+)$')
	if year ~= nil then
		return year .. "-10"
	end
	year = string.match (date, '^十一月 (%d+)$')
	if year ~= nil then
		return year .. "-11"
	end
	year = string.match (date, '^十二月 (%d+)$')
	if year ~= nil then
		return year .. "-12"
	end
	
	return date
end

return p