Module:CargoUtils
More actions
This documentation is transcluded from Module:CargoUtils/doc. Changes can be proposed in the talk page.
Function list |
---|
L 3 — p.format_date |
Module:CargoUtils provides common functions used when handling Cargo queries. It is a meta-module, meant for use by other modules, and should not be called from #invoke directly.
local p = {}
function p.format_date(datevalue, precision)
local lang = mw.language.getContentLanguage()
if (precision == '1') then
return lang:formatDate('j F Y', datevalue)
elseif (precision == '2') then
return lang:formatDate('F Y', datevalue)
elseif (precision == '3') then
return lang:formatDate('Y', datevalue)
end
end
return p