Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.
Module documentation[view][edit][history][purge]
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