Module:Sandbox/Cyborg Coder/Dates: Difference between revisions

Content deleted Content added
No edit summary
No edit summary
Line 24:
end
return "Valid"
end
 
function setContains(set, key)
return set[key] ~= nil
end
 
Line 35 ⟶ 39:
local mnth = date:match("%a+") or ""
mnth = string.upper(string.sub(mnth, 1, 1)) .. string.sub(mnth, 2)
if setContains(months[, string.lower(string.sub(mnth, 1, 3))] ~= nil) then mnth = date:match("%u%a+") or "" end
d, y = tonumber(d) or 1, tonumber(y) or 0
local m = month_idx[mnth:sub(1,3):lower()] or tonumber(date:match("%D0(%d)")) or 0