Module:Convert Month: Difference between revisions

From Stiles Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 10: Line 10:
end
end
end
end
return p._main(args[1], args[2])
return p._main(args)
end
end


function p._main(monthnumber, setting)
function p._main(args)
  if setting == "Solandria" then
monthnumber = tonumber(args[1])
    monthNames = {"Miry", "Ozdary", "Rydust", "Iptust", "Tosey", "Iverly", "Eohe", "Kasgust", "Andust", "Bepry", "Nindust", "Tymust", "Ekage", "Aphly", "Asust", "Syranust"}
setting = args[2]
  elseif setting == "Eberron" then
if setting == "Solandria" then
  monthNames = {"Zarantyr", "Olarune", "Therendor", "Eyre", "Dravago", "Nymm", "Lharvion", "Barrakas", "Rhann", "Sypheros", "Aryth", "Vult"}
monthNames = {"Miry", "Ozdary", "Rydust", "Iptust", "Tosey", "Iverly", "Eohe", "Kasgust", "Andust", "Bepry", "Nindust", "Tymust", "Ekage", "Aphly", "Asust", "Syranust"}
  elseif setting == "Forgotten Realms" then
elseif setting == "Eberron" then
  monthNames = {"Hammer", "Alturiak", "Ches", "Tarsakh", "Mirtul", "Kythorn", "Flamerule", "Eleasis", "Eleint", "Marpenoth", "Uktar", "Nightal"}
monthNames = {"Zarantyr", "Olarune", "Therendor", "Eyre", "Dravago", "Nymm", "Lharvion", "Barrakas", "Rhann", "Sypheros", "Aryth", "Vult"}
  elseif setting == "IRL" then
elseif setting == "Forgotten Realms" then
  monthNames = {"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"}
monthNames = {"Hammer", "Alturiak", "Ches", "Tarsakh", "Mirtul", "Kythorn", "Flamerule", "Eleasis", "Eleint", "Marpenoth", "Uktar", "Nightal"}
  end
elseif setting == "IRL" then
  month = monthNames[tonumber(monthnumber[1])]
monthNames = {"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"}
  return month
end
month = monthNames[monthnumber]
return month
end
end


return p
return p

Revision as of 19:40, 26 May 2022

Documentation for this module may be created at Module:Convert Month/doc

local p = {}

function p.main(frame)
	local orgiArgs = frame:getParent().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[1])
	setting = args[2]
	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]
	return month
end

return p