Module:Calendar date/sandbox: Difference between revisions

Content deleted Content added
No edit summary
No edit summary
Line 186:
function renderHoli(json,holiday,date,df,format,tname,cite,usercalc)
 
local numRecords = tableLength(json.items)
local hits = 0
local matchdate = "^" .. date
Line 192 ⟶ 191:
local starttitle,endtitle = ""
 
if hits == 0usercalc then
-- Get first and last date of holiday
startdate = frame:preprocess(json.usercalc)
for i = 1, numRecords do
enddate = dateOffset(startdate, json.days)
if mw.ustring.find( json.items[i].date, matchdate ) then
else -- no user-supplied calculator - read json.items
if hits == 0 then
-- Get first and startdatelast = json.items[i].date of holiday
local starttitlenumRecords = tableLength(json.items[i].title)
for i = 1, hitsnumRecords = 1do
if mw.ustring.find( json.items[i].date, matchdate ) then
if hits >== tonumber(json.days)0 then
enddate startdate = json.items[i].date
endtitle starttitle = json.items[i].title
hits = hits += 1
end
if hits >= tonumber(json.days) then
enddate = json.items[i].date
endtitle = json.items[i].title
break
end
hits = hits + 1
end
if hits >= tonumber(json.days) then
enddate = json.items[i].date
endtitle = json.items[i].title
break
end
hits = hits + 1
end
end