Module:Date Stuff: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
No edit summary
Line 11: Line 11:
end
end


--Takes a short date and converts it to a long date (12-18-392 to Tymust 18, 392)
function convertDate(date)
function p.solandria(frame)
  --Sets date variable to the first frame argument
  date = frame.args[1]
   --Splits the date
   --Splits the date
   date = Split(date, "-")
   date = Split(date, "-")
Line 58: Line 55:
     error("invalid opperation")
     error("invalid opperation")
   end
   end
 
  date = {month, day, year}
 
  return date
end
 
--Takes a short date and converts it to a long date (12-18-392 to Tymust 18, 392)
function p.solandria(frame)
  --Sets date variable to the first frame argument
  date = frame.args[1]
  --Calls the convert date function to convert short date to long date
  date = convertDate(date)


   --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 = month.." "..day..", "..year
   date = date[1].." "..date[2]..", "..date[3]
   return date
   return date
end
end
Line 72: Line 83:


   --Converts the first given date to a long date
   --Converts the first given date to a long date
   convertedDate = p.solandria(birthDate)
   convertedDate = convertDate(birthDate)


   --Splits the first date given
   --Splits the first date given

Navigation menu