Content deleted Content added
No edit summary |
No edit summary |
||
Line 304:
--- Parse JSON files
local cfgfp = mw.title.makeTitle( 'Template', tname .. '/Configuration.
if not cfgfp.exists then
return inlineError("holiday", 'File missing: Template:' .. tname .. '/Configuration.
end
local jsoncfg, jsonlocal = nil
jsoncfg = mw.text.jsonDecode( cfgfp:getContent() )
if not jsoncfg then
return inlineError("holiday", 'Error in file: Template:' .. tname .. '/Configuration.
end
local isAvail, it = isHolidayAvail( jsoncfg, holiday )
if isAvail then
if not jsoncfg.main.event[it].datasource then
return inlineError("holiday", 'Template:' .. tname .. '/Configuration.
end
if isAvail == "localfile" then -- dates are contained in a local JSON file
|