(Created page with "local getArgs = require('Module:Arguments').getArgs local Logos = {} function Logos.main(frame) local args = getArgs(frame) local enteredLogos = {} local currentDate = os.date('%Y-%m-%d') for key, value in ipairs (args) do local values = mw.text.jsonDecode(value) if (values.start == nil or values.start < currentDate) and (values['end'] == nil or values['end'] > currentDate) then enteredLogos['all'] = values.logoAll enteredLogos['light'] = values.logoLigh...") |
No edit summary |
||
Line 1: | Line 1: | ||
local getArgs = require('Module:Arguments').getArgs | local getArgs = require('Module:Arguments').getArgs | ||
VariablesLua = mw.ext.VariablesLua | |||
local Logos = {} | local Logos = {} | ||
Line 8: | Line 8: | ||
local currentDate = os.date('%Y-%m-%d') | local currentDate = os.date('%Y-%m-%d') | ||
if (args.start == nil or args.start < currentDate) and (args['end'] == nil or args['end'] > currentDate) then | |||
VariablesLua.vardefine( 'logoAll', args.logoAll ) | |||
VariablesLua.vardefine( 'logoLight', args.logoLight ) | |||
VariablesLua.vardefine( 'logoDark', args.logoDark ) | |||
end | end | ||
return | |||
return 'yes' | |||
end | end | ||
return Logos | return Logos |
Revision as of 19:03, 5 May 2023
Documentation for this module may be created at Module:Logos/doc
local getArgs = require('Module:Arguments').getArgs
VariablesLua = mw.ext.VariablesLua
local Logos = {}
function Logos.main(frame)
local args = getArgs(frame)
local enteredLogos = {}
local currentDate = os.date('%Y-%m-%d')
if (args.start == nil or args.start < currentDate) and (args['end'] == nil or args['end'] > currentDate) then
VariablesLua.vardefine( 'logoAll', args.logoAll )
VariablesLua.vardefine( 'logoLight', args.logoLight )
VariablesLua.vardefine( 'logoDark', args.logoDark )
end
return 'yes'
end
return Logos