local p = local getArgs = require('Module:Arguments').getArgs
local diag ="";
local validmonth =
function isValidMonth(s) -- local mymonth = mw.ustring.gsub(s, "^%s*(.*%S)%s+%d%d%d%d%s*$", "$1") local mymonth = mw.ustring.gsub(s, "%s+%d%d%d%d%s*$", "") diag = diag .. "\nmonthparse = [" .. s .. "] / [" .. mymonth .. "]\n" if (validmonth[string.lower(mymonth)]
function p.main(frame) local rawcats = local nvalid = 0 local args = getArgs(frame)
local listedargslist = ""; for i, v in ipairs(frame.args) do listedargslist = listedargslist .. "* i=[" .. i .. "] v = [" .. v .."]\n" end local electionyear =args['electionyear']; if (electionyear
nil) or (mw.ustring.match(electionyear, "^%s*$") ~= nil)) then return diag .. "" elseif (mw.ustring.match(electionyear, "^%s*%d%d%d%d%s*$") ~= nil) then return diag .. "" elseif (mw.ustring.match(electionyear, "^.*%s+%d%d%d%d%s*$") ~= nil) then if (isValidMonth(electionyear)) then return diag .. "" else return diag .. "" end else return diag .. "" endend
return p