יחידה:גיל לערכי אישים: הבדלים בין גרסאות בדף

ביטול גרסה 22925250 של ערן (שיחה) התנגדות מקיר לקיר לתיקון זה. ראו ויקיפדיה:תבנית/אולם דיונים#חישוב הגיל נעלם
מאין תקציר עריכה
שורה 128: שורה 128:
end
end
local success, AgeYears = pcall(dateParser.age, BirthDate , DeathDate)
local success, Age = pcall(dateParser.age, BirthDate , DeathDate)
if success then
if success then
if AgeYears == 1 then
AgeYears = Age.year
result = prefix..'שנה'
if Age.year == 0 then
elseif AgeYears == 2 then
if Age.month == 1 then
result = prefix..'שנתיים'
result = prefix..'חודש'
elseif Age.month == 2 then
result  = prefix..'חודשיים'
else
result = prefix..tostring(Age.month)..' חודשים'
end
if Age.day > 0 then
if Age.day == 1 then
result = result..' ויום'
elseif Age.day == 2 then
result = result..' ויומיים'
else
result = result..'  ו־'..tostring(Age.day)..' ימים'
end
end
elseif Age.year < 3 then
if Age.year == 1 then
result = prefix..'שנה'
elseif Age.year == 2 then
result = prefix..'שנתיים'
end
if Age.month == 1 then
result = result..' וחודש'
elseif Age.month == 2 then
result  = result..' וחודשיים'
else
result = result..' ו־'..tostring(Age.month)..' חודשים'
end
else
else
result = prefix..tostring(AgeYears)
result = prefix..tostring(Age.year)
end
end
if BirthDate.precision < dateParser.PRECISION.MONTH or (DeathDate and DeathDate.precision < dateParser.PRECISION.MONTH) then
if BirthDate.precision < dateParser.PRECISION.MONTH or (DeathDate and DeathDate.precision < dateParser.PRECISION.MONTH) then