Documentation for this module may be created at Module:Sandbox/Ohmomar/Dates/doc
local p = {}
p.dateextract = function(frame)
local date = frame.args.date or ""
local months = { "jan", "feb", "mar", "apr", "may", "jun", "jul", "aug", "sep", "oct", "nov", "dec" }
local d, y = date:match("(%d+)%D+(%d+)")
local mnth = date:match("%a+") or ""
d, y = tonumber(d) or 1, tonumber(y) or 0
local m = mnth:sub(1,3):lower() or 0
if format == "dmy" then
local out = d.." "..m.." "..y
return out
else
if format == "mdy" then
local out = m.." "..d.." "..y
return out
else
end
end
end
return p