Module:IsValidMonthName/doc

MyWikiBiz, Author Your Legacy — Tuesday June 18, 2024
Jump to navigationJump to search

This is the documentation page for Module:IsValidMonthName

Template:Module rating 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: Template:Param

Usage

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

isFullMonthName
  • {{#invoke:IsValidMonthName|isFullMonthName|mytext}}
  • {{#invoke:IsValidMonthName|isFullMonthName|mytext|ignorecase}}
isShortMonthName
  • {{#invoke:IsValidMonthName|isShortMonthName|mytext}}
  • {{#invoke:IsValidMonthName|isShortMonthName|mytext|ignorecase}}
isMonthName
  • {{#invoke:IsValidMonthName|isMonthName|mytext}}
  • {{#invoke:IsValidMonthName|isMonthName|mytext|ignorecase}}

See also