Toggle menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Module:AgeTemplate: Difference between revisions

From ProleWiki, the proletarian encyclopedia
m (Further debugging)
m (Not sure what's wrong, trying different arguments)
Line 9: Line 9:
if arg1 == "1" or arg1 == "2" or arg1 == "3" then
if arg1 == "1" or arg1 == "2" or arg1 == "3" then
local initialDate = pframe.args[2]
local initialDate = arg2
else
else
local initialDate = pframe.args[1]
local initialDate = arg1
end
end
return "initialDate: " .. pframe.args[1]
return "initialDate: " .. initialDate
end
end
-- local year,month,day = string.match(initialDate, '(%d+)-(%d+)-(%d+)')
-- local year,month,day = string.match(initialDate, '(%d+)-(%d+)-(%d+)')

Revision as of 14:53, 3 September 2022

local p = {}

function p.age( frame )
	local pframe = frame:getParent()
	
	local arg1 = pframe.args[1]
	local arg2 = pframe.args[2]
	local arg3 = pframe.args[3]
	
	if arg1 == "1" or arg1 == "2" or arg1 == "3" then
		local initialDate = arg2
		else
			local initialDate = arg1
	end
	return "initialDate: " .. initialDate
end
	-- local year,month,day = string.match(initialDate, '(%d+)-(%d+)-(%d+)')
	-- return "Year: " .. year .. ", Month: " .. month .. ", Day: " .. day
-- end
return p