More languages
More actions
m (Not sure what's wrong, trying different arguments) |
m (Removed initialDate from local inside if) |
||
Line 8: | Line 8: | ||
local arg3 = pframe.args[3] | local arg3 = pframe.args[3] | ||
local initialDate = "" | |||
if arg1 == "1" or arg1 == "2" or arg1 == "3" then | if arg1 == "1" or arg1 == "2" or arg1 == "3" then | ||
initialDate = arg2 | |||
else | else | ||
initialDate = arg1 | |||
end | end | ||
return "initialDate: " .. initialDate | return "initialDate: " .. initialDate |
Revision as of 14:54, 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]
local initialDate = ""
if arg1 == "1" or arg1 == "2" or arg1 == "3" then
initialDate = arg2
else
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