Module:Date Stuff: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 43: Line 43:
   end
   end
end
end
--Converts a Solandria short from dat to a Solandira long from date
function p.solandria(frame)
  date = convertShortDate(frame.args[1], "solandria")
 
  return writeDate(date)
end


--Calculates a persons age based on which calendar to use.
--Calculates a persons age based on which calendar to use.
function p.age(frame)
function age(firstDate, secondDate, status, calendar)
  --Takes our varibales from the frame and names them
  firstDate = frame.args[1]
  secondDate = frame.args[2]
  status = frame.args[3]
  calendar = frame.args[4]
 
   --checks if firstDate is not nil, and if it is returns the second date
   --checks if firstDate is not nil, and if it is returns the second date
   if firstDate ~= nil then
   if firstDate ~= nil then
Line 83: Line 67:
     return writeDate(secondDate).." (aged "..age..")"
     return writeDate(secondDate).." (aged "..age..")"
   end
   end
end
--Converts a Solandria short from dat to a Solandira long from date
function p.dateSolandria(frame)
  return writeDate(convertShortDate(frame.args[1], "solandria"))
end
--Calculates a persons age based on which calendar to use.
function p.ageSolandria(frame)
  return age(frame.args[1], frame.args[2], frame.args[3], "solandria")
end
end


return p
return p