Module:Logos: Difference between revisions

From TwogPedia
No edit summary
No edit summary
 
Line 10: Line 10:


if (args.start == nil or args.start < currentDate) and (args['end'] == nil or args['end'] > currentDate) then
if (args.start == nil or args.start < currentDate) and (args['end'] == nil or args['end'] > currentDate) then
VariablesLua.vardefine( 'logoAll', args.logoAll or nil )
if args.logoAll then VariablesLua.vardefine( 'logoAll', args.logoAll ) end
VariablesLua.vardefine( 'logoLight', args.logoLight or nil )
if args.logoLight then VariablesLua.vardefine( 'logoLight', args.logoLight ) end
VariablesLua.vardefine( 'logoDark', args.logoDark or nil )
if args.logoDark then VariablesLua.vardefine( 'logoDark', args.logoDark ) end
end
end



Latest revision as of 19:22, 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
		if args.logoAll then VariablesLua.vardefine( 'logoAll', args.logoAll ) end
		if args.logoLight then VariablesLua.vardefine( 'logoLight', args.logoLight ) end
		if args.logoDark then VariablesLua.vardefine( 'logoDark', args.logoDark ) end
	end

	return 'yes'
end

return Logos