4,595
edits
No edit summary |
No edit summary |
||
Line 84: | Line 84: | ||
--Calculates a persons age using the specified calendar | --Calculates a persons age using the specified calendar | ||
function p._age(args) | function p._age(args) | ||
birthDate = args[1] | birthDate = convertShortDate(args[1], args[4]) | ||
secondDate = args[2] | secondDate = convertShortDate(args[2], args[4]) | ||
status = args[3] | status = args[3] | ||
--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. | ||
Line 121: | Line 113: | ||
--Determines if age or aged is required | --Determines if age or aged is required | ||
if status == "alive" then | if status == "alive" then | ||
return writeDate(birthDate) | return writeDate(birthDate).." (age "..age..")" | ||
elseif status == "dead" then | elseif status == "dead" then | ||
return writeDate(secondDate).." (aged "..age..")" | return writeDate(secondDate).." (aged "..age..")" |