Changes

MyWikiBiz, Author Your Legacy — Sunday September 07, 2025
Jump to navigationJump to search
Pywikibot 6.4.0

{{Module rating |beta<!-- Values: pre-alpha • alpha • beta • release • protected -- If a rating not needed/relevant, delete this template call -->}}
<!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see [[Wikipedia:Wikidata]]) -->
A simple module to check whether a supplied string is a valid name of a month in the Julian or Gregorian calendars

== Operation ==

If the first parameter is the name of month, then it returns the parameter. In all other cases, it returns an empty string. (This return of a null string for a non-match allows the module to be used in templates simply by checking that the result is not an empty string.

It has three callable functions:

;isFullMonthName:
:Checks whether the parameter is the full name of a month, e.g. July or October
;isShortMonthName:
:Checks whether the parameter is the three-letter short name of a month, e.g. Jul or Oct
;isMonthName:
:Checks whether the parameter is either:
:a) the full name of a month, e.g. July or October
:b) the three-letter short name of a month, e.g. Jul or Oct

By default, the checks are case-sensitive. However, with function, case-insensitivity can be specified by supplying a second parameter: {{Param|ignorecase}}

== Usage ==

For clarity of code, this module is best called through one of the three wrapper templates: {{tl|Is valid full month name}}, {{tl|Is valid short month name}}, and {{tl|Is valid month name}}

;isFullMonthName
* <code><nowiki>{{</nowiki>#invoke:{{BASEPAGENAME}}|''isFullMonthName''|mytext}}</code>
* <code><nowiki>{{</nowiki>#invoke:{{BASEPAGENAME}}|''isFullMonthName''|mytext|ignorecase}}</code>

;isShortMonthName
* <code><nowiki>{{</nowiki>#invoke:{{BASEPAGENAME}}|''isShortMonthName''|mytext}}</code>
* <code><nowiki>{{</nowiki>#invoke:{{BASEPAGENAME}}|''isShortMonthName''|mytext|ignorecase}}</code>

;isMonthName
* <code><nowiki>{{</nowiki>#invoke:{{BASEPAGENAME}}|''isMonthName''|mytext}}</code>
* <code><nowiki>{{</nowiki>#invoke:{{BASEPAGENAME}}|''isMonthName''|mytext|ignorecase}}</code>

== See also ==
* {{tl|Is valid month name}}
* {{tl|Is valid full month name}},
* {{tl|Is valid short month name}}

<includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox | |
<!-- Categories below this line, please; interwikis at Wikidata -->

}}</includeonly>

Navigation menu