Module:TeamImages: Difference between revisions
From TwogPedia
No edit summary |
No edit summary |
||
Line 15: | Line 15: | ||
mw.logObject(values) | mw.logObject(values) | ||
if (values.start == nil or values.start < currentDate) and (values['end'] == nil or values['end'] > currentDate) then | if (values.start == nil or values.start < currentDate) and (values['end'] == nil or values['end'] > currentDate) then | ||
VariablesLua.vardefine(logoLight, values.logoLight) | VariablesLua.vardefine('logoLight', values.logoLight) | ||
VariablesLua.vardefine(logoDark, values.logoLight) | VariablesLua.vardefine('logoDark', values.logoLight) | ||
end | end | ||
end | end | ||
Line 22: | Line 22: | ||
mw.log(logos) | mw.log(logos) | ||
mw.logObject(logos) | mw.logObject(logos) | ||
return logos | -- return logos | ||
end | end | ||
return TeamImages | return TeamImages |
Revision as of 19:22, 7 October 2022
Documentation for this module may be created at Module:TeamImages/doc
local getArgs = require('Module:Arguments').getArgs
VariablesLua = mw.ext.VariablesLua
local TeamImages = {}
function TeamImages.main(frame)
local args = getArgs(frame)
local logos = {}
mw.log('args')
mw.logObject(args)
local currentDate = os.date('%Y-%m-%d')
for key, value in ipairs (args) do
local values = mw.text.jsonDecode(value)
mw.log('VALUES')
mw.logObject(values)
if (values.start == nil or values.start < currentDate) and (values['end'] == nil or values['end'] > currentDate) then
VariablesLua.vardefine('logoLight', values.logoLight)
VariablesLua.vardefine('logoDark', values.logoLight)
end
end
mw.log('IMAGES')
mw.log(logos)
mw.logObject(logos)
-- return logos
end
return TeamImages
No categories