Module:Year navigation
Appearance
local getArgs = require("Module:Args").getArgs
local infobox = require("Module:Infobox")
local p = {}
function p._main(args)
local year = args[1]
if year == 0 then
return error("Year cannot be 0. There was no [[year 0]].")
end
local millenium
if year > 2000 then
millenium = [[3rd millenium]]
elseif year > 1000 then
millenium = [[2nd millenium]]
elseif year > 0 then
millenium = [[1st millenium]]
else
millenium = [[1st millenium BC|1st millenium <small>BC</small>]]
end
return infobox.infobox({
label1 = "[[List of decades, centuries, and millennia|Millennium]]:",
data1 = millenium
})
end
function p.main(frame)
local args = getArgs(frame)
if not args[1] then
args[1] = frame:getTitle()
end
return p._main(args)
end
return p