Module:Convert Month: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
(4 intermediate revisions by the same user not shown) | |||
Line 2: | Line 2: | ||
function p.main(frame) | function p.main(frame) | ||
local orgiArgs = frame | local orgiArgs = frame.args | ||
local args = {} | local args = {} | ||
for k, v in pairs(orgiArgs) do | for k, v in pairs(orgiArgs) do | ||
Line 10: | Line 10: | ||
end | end | ||
end | end | ||
return args | return p._main(args) | ||
end | end | ||
function p._main(args) | function p._main(args) | ||
monthnumber = tonumber(args[ | monthnumber = tonumber(args[2]) | ||
setting = args[ | setting = args[1] | ||
if setting == "Solandria" then | if setting == "Solandria" then | ||
monthNames = {"Miry", "Ozdary", "Rydust", "Iptust", "Tosey", "Iverly", "Eohe", "Kasgust", "Andust", "Bepry", "Nindust", "Tymust", "Ekage", "Aphly", "Asust", "Syranust"} | monthNames = {"Miry", "Ozdary", "Rydust", "Iptust", "Tosey", "Iverly", "Eohe", "Kasgust", "Andust", "Bepry", "Nindust", "Tymust", "Ekage", "Aphly", "Asust", "Syranust"} | ||
Line 25: | Line 25: | ||
monthNames = {"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"} | monthNames = {"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"} | ||
end | end | ||
month = monthNames[monthnumber] | month = monthNames[monthnumber].." ("..monthnumber..")" | ||
return month | return month | ||
end | end | ||
return p | return p |
Latest revision as of 19:56, 26 May 2022
Documentation for this module may be created at Module:Convert Month/doc
local p = {}
function p.main(frame)
local orgiArgs = frame.args
local args = {}
for k, v in pairs(orgiArgs) do
v = v:match('^%s*(.-)%s*$')
if v ~= '' then
args[k] = v
end
end
return p._main(args)
end
function p._main(args)
monthnumber = tonumber(args[2])
setting = args[1]
if setting == "Solandria" then
monthNames = {"Miry", "Ozdary", "Rydust", "Iptust", "Tosey", "Iverly", "Eohe", "Kasgust", "Andust", "Bepry", "Nindust", "Tymust", "Ekage", "Aphly", "Asust", "Syranust"}
elseif setting == "Eberron" then
monthNames = {"Zarantyr", "Olarune", "Therendor", "Eyre", "Dravago", "Nymm", "Lharvion", "Barrakas", "Rhann", "Sypheros", "Aryth", "Vult"}
elseif setting == "Forgotten Realms" then
monthNames = {"Hammer", "Alturiak", "Ches", "Tarsakh", "Mirtul", "Kythorn", "Flamerule", "Eleasis", "Eleint", "Marpenoth", "Uktar", "Nightal"}
elseif setting == "IRL" then
monthNames = {"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"}
end
month = monthNames[monthnumber].." ("..monthnumber..")"
return month
end
return p