Module:Navbox timeline: Difference between revisions

No edit summary
Replaced month text with numbers
 
Line 19: Line 19:


-- Get month abbreviation
-- Get month abbreviation
local function getMonthAbbr(month)
local function getMonthNum(month)
local months = {'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
return tostring(month)
'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'}
return months[month] or ''
end
end


-- Parse date string (supports YYYY, YYYY-MM, or YYYY-YYYY formats)
-- Parse date string (supports YYYY, YYYY-MM, or YYYY-YYYY formats)
Line 266: Line 265:
:cssText(args.monthstyle)
:cssText(args.monthstyle)
:cssText('width:' .. monthWidth .. '%')
:cssText('width:' .. monthWidth .. '%')
:wikitext(getMonthAbbr(monthNum))
:wikitext(getMonthNum(monthNum))
yearStart = yearStart + 1
yearStart = yearStart + 1