Module:Timeline of release years/sandbox: Difference between revisions

Content deleted Content added
No edit summary
First stab
Line 91:
right(builder, args, year, itemNum, itemList)
end
 
local function rowCompressed(builder, args, year, emptyYear)
local itemNum, itemList = items(args, year)
-- If we're not compressing and there's no items, return this year for tracking.
if #itemList < 1 then
return year
end
-- If we have an empty year, output empty row.
if(emptyYear ~= nil) then
builder = builder:tag('tr')
if(year ~= emptyYear) then
left(builder, args, emptyyear .. ' ~ ' .. (year-1), 0)
right(builder, args, emptyyear .. ' ~ ' .. (year-1), 0, {})
else
left(builder, args, (year-1), 0)
right(builder, args, (year-1), 0, {})
end
end
 
builder = builder:tag('tr')
left(builder, args, year, itemNum)
right(builder, args, year, itemNum, itemList)
return nil
end
 
 
--------------------------------------------------------------------------------
Line 139 ⟶ 167:
end
 
local emptyyear = nil
for year = firstyear, lastyear do
rowif(ret, args,.compressEmpty) year)then
local yearCheck = rowCompress(ret, args, year, emptyyear)
if (emptyyear == nil and yearCheck ~= nil) or (emptyyear ~= nil and yearcheck == nil) then
emptyyear = yearCheck
end
else
row(ret, args, year)
end
end