Content deleted Content added
|
|
-- Days
local colspancellCount = 1 - dateStuff.firstWeekday -- 1Tracks the number of day cells. Negative values used for initial blank cells.
localwhile cellCount =< 0#dayStrings do -- Tracks the number of dayWeekly cells.rows
local firstDayRowweeklyRow = root:tag('tr')
for i = 1, 7 do -- Always make 7 cells.▼
if colspan > 1 then
:attr('colspan', tostring(colspan))
elseif colspan == 1 then
firstDayRow:tag('td')
end
for i = colspan + 1, 7 do -- Finish the first row
cellCount = cellCount + 1
firstDayRow:tag('td')
:css{['text-align'] = 'center'}
:wikitext(dayStrings[cellCount])
end
while cellCount < #dayStrings do -- Second day row onwards
local otherDayRow = root:tag('tr')
cellCount = cellCount + 1
local dayString = dayStrings[cellCount] or " " -- Use a blank cell if there is no corresponding dateString
▲ firstDayRow weeklyRow:tag('td')
if not dayString then
dayString = " "
end
otherDayRow:tag('td')
:css{['text-align'] = 'center'}
:wikitext(dayString)
|