Content deleted Content added
debug |
default day to 1, so month, year is valid |
||
(6 intermediate revisions by the same user not shown) | |||
Line 16:
"jul", "aug", "sep", "oct", "nov", "dec" }
local days_in_month = { 31, 0, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }
days_in_month[0] = 0
local month_idx = {}
for i, v in ipairs(months) do
Line 21 ⟶ 22:
end
local function day_try(
days_in_month[2] = leapd(y)
if d <
return "Invalid"
end
return "Valid"
end
function p.dayTry(frame)
local date = frame.args.date or mw.text.trim(frame.args[1] or "")
if date == "" then date = "No date" end
local d, y = date:match("(%d+)%D+(%d+)")
local
local m = month_idx[mnth:sub(1,3):lower()] or 0
-- return day_try(d, mnth, y)▼
return out .. "<br>"
end
|