Content deleted Content added
ElijahPepe (talk | contribs) No edit summary |
copy from Module:Age |
||
Line 729:
flag = 'usesCurrent',
omitZero = true,
range = '
},
age_full_years_nts = { -- {{age nts}}
Line 862:
end
return from_en(dateDifference(parms))
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
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',
Line 986 ⟶ 998:
sortKey = makeSort(value, sortable)
end
local result = (sortKey or '') .. substituteParameters(▼
mtext['txt-dda'],▼
date1:text(fmt_ymd),▼
▲ if age then
from_en(date1:text(fmt_date)),▼
▲ ageRange = from_en(dateDifference({
diff = diff,
show = 'y',
Line 999 ⟶ 1,010:
sep = 'sep_space',
}))
▲ end
▲ local result = (sortKey or '') .. substituteParameters(
▲ mtext['txt-dda'],
▲ date1:text(fmt_ymd),
▲ from_en(date1:text(fmt_date)),
)
local warnings = tonumber(frame.args.warnings)
|