Module:Age: Difference between revisions

100 bytes added ,  5 years ago
update from sandbox: use data-sort-value for sort keys per Module talk:Age#Sorting will use data-sort-value
(update from sandbox: Template:Death date and age now gives an error if the death date is in future by more than one day)
(update from sandbox: use data-sort-value for sort keys per Module talk:Age#Sorting will use data-sort-value)
Line 195:
if mw.ustring.len(extra) > 1 then
-- Parameter "~" gives "~3" whereas "over" gives "over 3".
if extra:sub(-6, -1) ~= extra .. ' ' 'then
extra = extra .. ' '
end
end
if flagCurrent then
Line 220 ⟶ 222:
sortKey = string.format('%d', sortKey) .. string.format('%015.0f', math.floor(value * 10^(14-mag)))
end
local lhs, rhsresult
if sortable == 'sortable_table' then
lhsresult = 'data-sort-value="_SORTKEY_"|'
lhs =elseif sortable == 'sortable_debug' andthen
rhs = '"|'
result = '<span data-sort-value="_SORTKEY_♠"><span style="border:1px solid">_SORTKEY_♠</span></span>'
else
result = '<span data-sort-value="_SORTKEY_♠"></span>'
lhs = sortable == 'sortable_debug' and
'<span style="border:1px solid;display:inline;" class="sortkey">' or
'<span style="display:none" class="sortkey">'
rhs = '♠</span>'
end
return lhs ..result:gsub('_SORTKEY_', sortKey .. rhs)
end
end
Line 351:
end
end
return (sortKey or '') .. makeExtra(args) .. (result or '')
end
 
Anonymous user