Module:Date Stuff: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 98: Line 98:
    
    
   --Checks which math formula to use, based on how much of the date there is.
   --Checks which math formula to use, based on how much of the date there is.
   if firstDate[4] == 1 or secondDate[4] == 1 or firstDate[5] == 1 or secondDate[5] == 1 or firstDate[2] <= secondDate[2] then
   if firstDate[4] == "year" or secondDate[4] == "year" or firstDate[4] == "month-year" or secondDate[4] == "month-year" or firstDate[2] <= secondDate[2] then
     age = math.floor(secondDate[3] - firstDate[3])
     age = math.floor(secondDate[3] - firstDate[3])
   elseif firstDate[2] >= secondDate[2] then
   elseif firstDate[2] >= secondDate[2] then