4,595
edits
No edit summary |
No edit summary |
||
Line 12: | Line 12: | ||
function convertDate(date) | function convertDate(date) | ||
--In place of a long if elseif, I've put all the months into a single variable, with each in its numerical place. | |||
monthNames = {"Miry", "Ozdary", "Rydust", "Iptust", "Tosey", "Iverly", "Eohe", "Kasgust", "Andust", "Bepry", "Nindust", "Tymust", "Ekage", "Aphly", "Asust", "Syranust"} | |||
--Splits the date | --Splits the date | ||
date = Split(date, "-") | date = Split(date, "-") | ||
--Saves the | --Saves the month part of the variable into a seperate month variable | ||
month = tonumber(date[1]) | month = tonumber(date[1]) | ||
--Takes the month variable and converts it to its text counterpart | --Takes the month variable and converts it to its text counterpart | ||
month = monthNames[month] | |||
--Checks to see if the month is a valid number | |||
if month == nil then | |||
error("Invalid month") | |||
error(" | |||
end | end | ||
--Takes the text month variable and adds it to the day and year variable with a comma | --Takes the text month variable and adds it to the day and year variable with a comma | ||
date = | date = month.." "..date[2]..", "..date[3] | ||
return date | return date | ||
Line 123: | Line 92: | ||
return p | return p | ||