View source for Module:Vgrtbl
MyWikiBiz, Author Your Legacy — Thursday June 05, 2025
Jump to navigationJump to searchYou do not have permission to edit this page, for the following reasons:
You can view and copy the source of this page.
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) == tonumber(str)
end
function p._text(dateText, name, v, s)
local retval = '<span style="white-space:normal;">'
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 .. '<span style="display:none">' .. lang:formatDate('Ym', dateText) .. '</span>'
end
local success2, result2 = pcall(lang.formatDate, lang, 'c', '1 ' .. dateText)
if success2 and result == result2 then
retval = retval .. lang:formatDate(v == '0' and 'Y-m' or 'F Y', dateText)
000
1:0
Templates used on this page:
Return to Module:Vgrtbl.