Module:Calendar date/sandbox: Difference between revisions

Content deleted Content added
No edit summary
No edit summary
Line 284:
end
 
--[[--------------------------< isAvailisHolidayAvail >-----------------------
 
Given the Configuration.js and name of holiday return if data type is usercalc, jsonfile or not-found (nil)
 
Given the Configuration.js and name of a holiday, return ifvalue data type is usercalc,of jsonfilejsoncfg.main.event[it].datatype orand not-foundindex (nil)number
Return nil if no holiday found
]]
 
Line 293:
 
local numRecords = tableLength(jsoncfg.main.event)
for iit = 1, numRecords do
if jsoncfg.main.event[iit].holiday:lower() == holiday:lower() then
if jsoncfg.main.event[iit].datatype:lower() == "calculator" then
return "calculator", iit
elseif jsoncfg.main.event[iit].datatype:lower() == "localfile" or jsoncfg.main.event[iit].datatype:lower() == "local file" then
return "localfile", iit
else
return nil, nil
end
end
end
return nil, nil