https://en.wikipedia.org/w/index.php?action=history&feed=atom&title=Module%3ATitle_monthnameModule:Title monthname - Revision history2025-06-08T16:46:32ZRevision history for this page on the wikiMediaWiki 1.45.0-wmf.4https://en.wikipedia.org/w/index.php?title=Module:Title_monthname&diff=1039155161&oldid=prevMusikBot II: Changed protection settings for "Module:Title monthname": High-risk template or module 6339 transclusions (more info) ([Edit=Require template editor access] (indefinite) [Move=Require template editor access] (indefinite))2021-08-17T01:26:09Z<p>Changed protection settings for "<a href="/wiki/Module:Title_monthname" title="Module:Title monthname">Module:Title monthname</a>": <a href="/wiki/Wikipedia:High-risk_templates" title="Wikipedia:High-risk templates">High-risk template or module</a> 6339 transclusions (<a href="/wiki/User:MusikBot_II/TemplateProtector" title="User:MusikBot II/TemplateProtector">more info</a>) ([Edit=Require template editor access] (indefinite) [Move=Require template editor access] (indefinite))</p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<tr class="diff-title" lang="en">
<td colspan="1" style="background-color: #fff; color: #202122; text-align: center;">← Previous revision</td>
<td colspan="1" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 01:26, 17 August 2021</td>
</tr><tr><td colspan="2" class="diff-notice" lang="en"><div class="mw-diff-empty">(No difference)</div>
</td></tr></table>MusikBot IIhttps://en.wikipedia.org/w/index.php?title=Module:Title_monthname&diff=993451194&oldid=prevMusikBot II: Protected "Module:Title monthname": High-risk template or module (more info) ([Edit=Require autoconfirmed or confirmed access] (indefinite))2020-12-10T18:00:31Z<p>Protected "<a href="/wiki/Module:Title_monthname" title="Module:Title monthname">Module:Title monthname</a>": <a href="/wiki/Wikipedia:High-risk_templates" title="Wikipedia:High-risk templates">High-risk template or module</a> (<a href="/wiki/User:MusikBot_II/TemplateProtector" title="User:MusikBot II/TemplateProtector">more info</a>) ([Edit=Require autoconfirmed or confirmed access] (indefinite))</p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<tr class="diff-title" lang="en">
<td colspan="1" style="background-color: #fff; color: #202122; text-align: center;">← Previous revision</td>
<td colspan="1" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 18:00, 10 December 2020</td>
</tr><tr><td colspan="2" class="diff-notice" lang="en"><div class="mw-diff-empty">(No difference)</div>
</td></tr></table>MusikBot IIhttps://en.wikipedia.org/w/index.php?title=Module:Title_monthname&diff=968019959&oldid=prevBrownHairedGirl: BrownHairedGirl moved page Module:Title month to Module:Title monthname without leaving a redirect: clearer description of purpose2020-07-16T18:42:30Z<p>BrownHairedGirl moved page <a href="/w/index.php?title=Module:Title_month&action=edit&redlink=1" class="new" title="Module:Title month (page does not exist)">Module:Title month</a> to <a href="/wiki/Module:Title_monthname" title="Module:Title monthname">Module:Title monthname</a> without leaving a redirect: clearer description of purpose</p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<tr class="diff-title" lang="en">
<td colspan="1" style="background-color: #fff; color: #202122; text-align: center;">← Previous revision</td>
<td colspan="1" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 18:42, 16 July 2020</td>
</tr><tr><td colspan="2" class="diff-notice" lang="en"><div class="mw-diff-empty">(No difference)</div>
</td></tr></table>BrownHairedGirlhttps://en.wikipedia.org/w/index.php?title=Module:Title_monthname&diff=968019801&oldid=prevBrownHairedGirl: create from sandboxed testing2020-07-16T18:41:12Z<p>create from sandboxed testing</p>
<p><b>New page</b></p><div>--[[ v1.00<br />
Split the page title into words then test each of them against<br />
the list of months.<br />
Optionally, an alternative page name may be supplied as a parameter.<br />
Return the first word which matches a months name ...<br />
unless the "match=" parameter specifies a diffreent match.<br />
If there is no match, then return an empty string ... unles<br />
the "nomatch" parameter specifies something different<br />
]]<br />
<br />
local getArgs = require('Module:Arguments').getArgs<br />
local p = {}<br />
<br />
-- config<br />
local nomatch = ""<br />
local matchnum = 1<br />
<br />
local monthList = {<br />
'January',<br />
'February',<br />
'March',<br />
'April',<br />
'May',<br />
'June',<br />
'July',<br />
'August',<br />
'September',<br />
'October',<br />
'November',<br />
'December'<br />
}<br />
<br />
-- splits a string into "words"<br />
-- a "word" is a set of characters delineated at each end by one <br />
-- or more whitespace characters or punctaution charaters<br />
function splitIntoWords(str)<br />
result = {}<br />
index = 1<br />
s = mw.ustring.gsub(str, "^[%s%p]+", "") -- strip leading whitespace or punctuation<br />
for s2 in mw.ustring.gmatch(s, "[^%s%p]+[%s%p]*") do<br />
s3 = mw.ustring.gsub(s2, "[%s%p]+$", "") -- strip trailing separators<br />
result[index] = s3<br />
index = index + 1<br />
end<br />
return result<br />
end<br />
<br />
-- returns the first word is the pagename which matches the name of a month<br />
-- ... or an empty string if there is no match<br />
function checkPagename(pn)<br />
-- split the pagename into sparate words<br />
titleWords = splitIntoWords(pn)<br />
<br />
nMatches = 0<br />
myMatches ={}<br />
<br />
-- check each words in turn, to see if it matches a month<br />
for w, thisWord in ipairs(titleWords) do<br />
-- check agaist each month<br />
-- if there is a match, then return that monthname<br />
for i, thisMonth in ipairs(monthList) do<br />
if (thisMonth == thisWord) then<br />
nMatches = nMatches + 1<br />
myMatches[nMatches] = thisMonth<br />
end<br />
end<br />
end<br />
<br />
if (nMatches == 0) then<br />
-- none of the title words matches a whole month<br />
return nomatch<br />
end<br />
<br />
if ((matchnum >= 1) and (matchnum <= nMatches)) then<br />
return myMatches[matchnum]<br />
end<br />
<br />
if (matchnum < 0) then<br />
matchnum = matchnum + 1 -- so that -1 is the last match etc<br />
if ((matchnum + nMatches) >= 1) then<br />
return myMatches[matchnum + nMatches]<br />
end<br />
end<br />
<br />
-- if we get here, we have not found a match at the position specified by "matchnum"<br />
return nomatch<br />
end<br />
<br />
function p.main(frame)<br />
local args = getArgs(frame)<br />
return p._main(args)<br />
end<br />
<br />
function p._main(args)<br />
if (args['nomatch'] ~= nil) then<br />
nomatch = args['nomatch']<br />
end<br />
<br />
-- by default, we return the first match<br />
-- but the optional "C" paarmeter sets the "matchnum" variable, which<br />
-- * for a positive matchnum "n", returns the nth match if it exists<br />
-- * for a positive matchnum "n", returns (if it exists) the nth match<br />
-- counting backwards from the end.<br />
-- So "match=-1" returns the last match<br />
-- and "match=-3" returns the 3rd-last match<br />
if (args['match'] ~= nil) then<br />
matchnum = tonumber(args['match'])<br />
if ((matchnum == nil) or (matchnum == 0)) then<br />
matchnum = 1<br />
end<br />
end<br />
<br />
-- by default, we use the current page<br />
-- but if the "page=" parameters is supplied, we use that<br />
-- so we try the parameter first<br />
thispagename = nil<br />
if ((args['page'] ~= nil) and (args['page'] ~= "")) then<br />
-- we have a non-empty "page" parameter, so we use it<br />
thispagename = args['page']<br />
else<br />
-- get the page title<br />
thispage = mw.title.getCurrentTitle()<br />
thispagename = thispage.text;<br />
end<br />
<br />
-- now check the pagename to try to find a month ananme<br />
result = checkPagename(thispagename)<br />
if (result == "") then<br />
return nomatch<br />
end<br />
return result<br />
end<br />
<br />
return p</div>BrownHairedGirl