Module:Navbox timeline: Difference between revisions
AZMindroma (talk | contribs) Attempting to introduce months again |
AZMindroma (talk | contribs) Replaced month text with numbers |
||
| (One intermediate revision by the same user not shown) | |||
| Line 19: | Line 19: | ||
-- Get month abbreviation | -- Get month abbreviation | ||
local function | local function getMonthNum(month) | ||
return tostring(month) | |||
return | |||
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( | :wikitext(getMonthNum(monthNum)) | ||
yearStart = yearStart + 1 | yearStart = yearStart + 1 | ||
| Line 354: | Line 353: | ||
targs.templatestyles = 'Module:Navbox timeline/styles.css' | targs.templatestyles = 'Module:Navbox timeline/styles.css' | ||
targs.list1 = tostring(wrapper) | targs.list1 = tostring(wrapper) | ||
targs.bodyclass = (targs.bodyclass or '') .. ' timeline-container' -- Add this line | |||
return navbox(targs) | return navbox(targs) | ||