local p =
local lang = mw.language.getContentLanguage
local function looksLikeYear(str) local success, result = pcall(lang.formatDate, lang, 'Y', '1-1-' .. str) return success and tonumber(result)
function p._text(dateText, name, v, s) local retval = '
' local success, result = pcall(lang.formatDate, lang, 'c', dateText) if looksLikeYear(dateText) or not success then retval = retval .. dateText else if s then retval = retval .. ''0' and 'Y-m' or 'F Y', dateText) else if s then retval = retval .. '
' end local formatString if v'2' then formatString = 'j F Y' else formatString = 'F j, Y' end retval = retval .. lang:formatDate(formatString, dateText) end end return retval .. ' (' .. name .. ')
'end ' end local success2, result2 = pcall(lang.formatDate, lang, 'c', '1 ' .. dateText) if success2 and resultfunction p.text(frame) local args = frame:getParent.args return p._text(args[1], args[2], args.v, args.s)end
local function tryDate(str) local success, result = pcall(lang.formatDate, lang, 'c', str) if success then return result else return str endend
function p.main(frame) local args = frame.args[1] and frame.args or frame:getParent.args local v = args.v or 1 if args.c
1 then retval = p._text(dates[val].display, table.concat(dates[val], '/'), v, 1) else retval = retval .. '
' .. p._text(dates[val].display, table.concat(dates[val], '/'), v) end end return retval endend
return p