4,599
edits
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
local p = {} | local p = {} | ||
function p. | function p.date(frame) | ||
local orgiArgs = frame:getParent().args | local orgiArgs = frame:getParent().args | ||
local args = {} | local args = {} | ||
Line 10: | Line 10: | ||
end | end | ||
end | end | ||
return p._date(args) | |||
end | |||
function p.age(frame) | |||
local orgiArgs = frame:getParent().args | |||
local args = {} | |||
for k, v in pairs(orgiArgs) do | |||
v = v:match('^%s*(.-)%s*$') | |||
if v ~= '' then | |||
args[k] = v | |||
end | |||
end | end | ||
return p._age(args) | |||
end | end | ||
Line 67: | Line 75: | ||
--Converts a short from date to a long from date using the specified calendar | --Converts a short from date to a long from date using the specified calendar | ||
function p. | function p._date(args) | ||
return writeDate(convertShortDate(args[ | return writeDate(convertShortDate(args[1], args[2])) | ||
end | end | ||
--Calculates a persons age using the specified calendar | --Calculates a persons age using the specified calendar | ||
function p. | function p._age(frame) | ||
firstDate = frame:getParent().args[1] | firstDate = frame:getParent().args[1] | ||
secondDate = frame:getParent().args[2] | secondDate = frame:getParent().args[2] |