Module:Age: Difference between revisions

Content deleted Content added
change default for {{age}} from range=no to range=dash per Template talk:Age#Inaccurate age shown
output nothing for Template:Birth_date_and_age + Template:Death_date_and_age if 'YYYY' is first parameter to avoid TemplateData auto value errors from Template:Infobox_musical_artist
Line 862:
end
return from_en(dateDifference(parms))
end
 
local function isFake(args)
-- Some templates have TemplateData with an auto value like "{{Birth date and age|YYYY|MM|DD}}".
-- Return true if that appears to be the case so the caller can output nothing rather than an error.
return args[1] == 'YYYY'
end
 
Line 867 ⟶ 873:
-- Implement [[Template:Birth date and age]].
local args = frame:getParent().args
if isFake(args) then
return ''
end
local options = {
missing1 = 'mt-need-valid-bd',
Line 940 ⟶ 949:
-- Implement [[Template:Death date and age]].
local args = frame:getParent().args
if isFake(args) then
return ''
end
local options = {
missing1 = 'mt-need-valid-dd',