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

שחזור לגרסה 27459777 מ־09:45, 11 במרץ 2020 מאת Dovno, עם תיקון - גם אם תאריך הוא תקין מבחינת יחידה:תאריך, לצורך חישוב הגיל הוא אינו תקין אם הוא מקורב ("המאה ה-11")
מאין תקציר עריכה
שורה 72: שורה 72:
end
end


function ageCalc(BirthDateStr, DeathDateStr, DisplayForAlive, DisplayForDead, Brackets, ApproxDate)
function ageCalc(BirthDateStr, DeathDateStr, DisplayForAlive, DisplayForDead, Brackets, ApproxDate, gender)
local frame = mw.getCurrentFrame()
local frame = mw.getCurrentFrame()
local warnings = {}
local warnings = {}
שורה 123: שורה 123:
else
else
--if (age_string) then
if gender == nil and entityId~=nil then
-- prefix = age_string..' '
local PropertyLink = require('Module:PropertyLink')
--else
gender = PropertyLink.getPropertyByOptions( 'P21', entityId )
prefix = frame:expandTemplate{ title = 'לפי מגדר/בדוק', args = { 'בן ', 'בת ', 'גיל: ' } }
end
--end
prefix = 'גיל: '
if (gender == "אישה טרנסג'נדרית") then gender = 'נקבה' end
if (gender == "גבר טרנסג'נדר") then gender = 'זכר' end
if gender == 'נקבה' then
prefix = 'בת '
elseif gender == 'זכר' then
prefix = 'בן '
end
end
end