Module:Age: Difference between revisions

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
 
m 1 revision imported
 
(2 intermediate revisions by 2 users not shown)
Line 1,125: Line 1,125:
end
end
return from_en(dateDifference(parms))
return from_en(dateDifference(parms))
end
local function templateGeneric(frame)
local name = frame.args.template
if not name then
return message('mt-template-x')
end
return ageGeneric(frame:newChild{title = mw.title.new(name, 10), args = frame.args})
end
end


Line 1,136: Line 1,144:
JULIANDAY = dateToJd,              -- Template:JULIANDAY
JULIANDAY = dateToJd,              -- Template:JULIANDAY
time_interval = timeInterval,      -- Template:Time_interval
time_interval = timeInterval,      -- Template:Time_interval
[''] = templateGeneric              -- same as age_generic, but can be invoked directly
}
}