p =
p.extractDate = function (frame) local date = frame.args.date or "invalid value" local format = frame.args.format or "recognize format" local output = "" if(date
nil then day = 1 end if month
nil then year = 2018 end output = "Year = " .. year .. "
Day = " .. day .. "
Month = ".. month return outputend
p.checkDate = function (frame) local us_mdY = frame.args.us_mdY local m, d, Y = us_mdY:match("(%d+)/(%d+)/(%d+)") local epoch = os.time local zeromdy = string.format("%02d/%02d/%04d", m, d, Y) return zeromdy
p.isValidDate = function (frame) local us_mdY = frame.args.us_mdY local m, d, y = us_mdY:match("(%d+)/(%d+)/(%d+)")
m, d, y = tonumber(m), tonumber(d), tonumber(y)
if d <= 0 or d > 31 or m <= 0 or m > 12 or y <= 0 then -- Cases that don't make sense return false elseif m
6 or m
11 then -- Apr, Jun, Sep, Nov can have at most 30 days return d <= 30 elseif m
0 or (y%100 ~= 0 and y%4
return p