Module:Calendar date/sandbox: Difference between revisions

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