మాడ్యూల్:Sandbox/Arjunaraoc/i18n dates
Jump to navigation
Jump to search
require('Module:No globals');
--[[--------------------------< M A I N >----------------------------------------------------------------------
use this from the debug console:
=p.main ('<lang_tag>')
where:
<lang_tag> is a language tag know to MediaWiki
]]
local function main (lang_tag)
local long_names_from_lang_object_t = {};
local short_names_from_lang_object_t = {};
local lang_obj = mw.language.new (lang_tag); -- make a new language object for the language supplied in <lang_tag>
for i=1, 12 do -- loop 12x and
long_names_from_lang_object_t[i] = lang_obj:formatDate ('F', '2018-' .. i .. '-1'); -- get long month name for each i
short_names_from_lang_object_t[i] = lang_obj:formatDate ('M', '2018-' .. i .. '-1'); -- get short month name for each i
end
return table.concat (short_names_from_lang_object_t, ' | ') .. '\n' .. table.concat (long_names_from_lang_object_t, ' | ')
end
--[[--------------------------< E X P O R T S >----------------------------------------------------------------
]]
return {
main = main,
}