モジュール:公開日別の記事
表示
このモジュールについての説明文ページを モジュール:公開日別の記事/doc に作成できます。
cal = {};
cal.wikitext = function(frame)
local table_style = "text-align:center;margin:0 auto;background:#f0f0ff;"
local table_width = "100%"
local tr_style = "border-bottom:thin solid navy;border-right:thin solid navy;background:#eff;width:10%;"
local td_style = "border-bottom:thin solid gray;border-right:thin solid gray;background:#fff;width:7%;font-size:small;"
local start_year = 2005
local start_month = 7
local current_year = tonumber(os.date("%Y"))
local current_month = tonumber(os.date("%m"))
local output = ""
output = output..string.format("{| style='%s' width='%s'\n",table_style,table_width)
for y = start_year,current_year do
output = output..string.format("|-\n")
output = output..string.format("| style='%s'|'''[[:Category:%d年|%d年]]'''\n",tr_style,y,y)
for m = 1,12 do
if (y == current_year and m > current_month) or (y == start_year and m < start_month) then
output = output..string.format("| style='%s'|%d月\n",td_style,m)
else
output = output..string.format("| style='%s'|[[:Category:%d年%d月|%d月]]\n",td_style,y,m,m)
end
end
end
output = output..string.format("|}")
return output
end
return cal