Content deleted Content added
nil |
test month |
||
Line 1:
local p = {}
local getArgs = require('Module:Arguments').getArgs
local validmonth = {
["january"] = "OK",
["february"] = "OK",
["march"] = "OK",
["april"] = "OK",
["may"] = "OK",
["june"] = "OK",
["july"] = "OK",
["august"] = "OK",
["september"] = "OK",
["october"] = "OK",
["november"] = "OK",
["december"] = "OK"
}
function isValidMonth(s)
local mymonth = mw.ustring.gub(s, "^%s*(.*%S)%s+%d%d%d%d%s*$", "$1")
if (validmonth[string.lower(mymonth)] == "OK") then
return true
end
return false
end
function p.main(frame)
local rawcats = {}
Line 25 ⟶ 50:
return listedargslist .. "[[:Category:CanElecResTopTest with bare year]]"
elseif (mw.ustring.match(electionyear, "^.*%s+%d%d%d%d%s*$") ~= nil) then
if (isValidMonth(electionyear)) then
return listedargslist .. "[[:Category:CanElecResTopTest with something before year]]"▼
return listedargslist .. "[[:Category:CanElecResTopTest with month year]]"
else
▲ return listedargslist .. "[[:Category:CanElecResTopTest with something before year]]"
end
else
return listedargslist .. "[[:Category:CanElecResTopTest with unrecognised value]]"
|