Teamplaid:MONTHNUMBER
Coltas
This template is used on a very large number of pages. To avoid large-scale disruption and unnecessary server load, any changes to this template should first be tested in its /sandbox or /testcases subpages, or in your own user space. The tested changes can then be added to this page in one single edit. Please consider discussing any changes on the talk page before implementing them. |
This template returns the cyclic integer month number (between 1 and 12) of the month whose real number is in parameter. Alternatively, the month can be given with its Gaelic name (complete definite, complete indefinite, or abbreviated, with capitals or small letters) or with its English name (complete or abbreviated to 3 characters, with capitals or small letters).
Does not play nicely with "subst:"
Co-chàradh - Syntax
[deasaich]- {{MONTHNUMBER|month}}
- The month value is interpreted modulo 12 (extra leading zeroes are ignored, negative numbers are accepted, all numbers are rounded to floor).
Examples for all definite Gaelic month names
[deasaich]- {{MONTHNUMBER|am Faoilleach}} returns 1
- {{MONTHNUMBER|am Faoilteach}} returns 1
- {{MONTHNUMBER|an Gearran}} returns 2
- {{MONTHNUMBER|am Màrt}} returns 3
- {{MONTHNUMBER|an Giblean}} returns 4
- {{MONTHNUMBER|an Cèitean}} returns 5
- {{MONTHNUMBER|an t-Òg-mhios}} returns 6
- {{MONTHNUMBER|an t-Ògmhios}} returns 6
- {{MONTHNUMBER|an t-Iuchar}} returns 7
- {{MONTHNUMBER|an Lùnastal}} returns 8
- {{MONTHNUMBER|an t-Sultain}} returns 9
- {{MONTHNUMBER|an Dàmhair}} returns 10
- {{MONTHNUMBER|an t-Samhain}} returns 11
- {{MONTHNUMBER|an Dùbhlachd}} returns 12
Examples for all definite Gaelic month names (mixed cases)
[deasaich]- {{MONTHNUMBER|AM FAOILLEACH}} returns 1
- {{MONTHNUMBER|am faoilteach}} returns 1
- {{MONTHNUMBER|An Gearran}} returns 2
- {{MONTHNUMBER|Am Màrt}} returns 3
- {{MONTHNUMBER|An Giblean}} returns 4
- {{MONTHNUMBER|An Cèitean}} returns 5
- {{MONTHNUMBER|An t-Òg-mhios}} returns 6
- {{MONTHNUMBER|An t-Ògmhios}} returns 6
- {{MONTHNUMBER|An t-Iuchar}} returns 7
- {{MONTHNUMBER|An Lùnastal}} returns 8
- {{MONTHNUMBER|An t-Sultain}} returns 9
- {{MONTHNUMBER|An Dàmhair}} returns 10
- {{MONTHNUMBER|An t-Samhain}} returns 11
- {{MONTHNUMBER|an dùbhlachd}} returns 12
Examples for all indefinite Gaelic month names
[deasaich]- {{MONTHNUMBER|Faoilleach}} returns 1
- {{MONTHNUMBER|Faoilteach}} returns 1
- {{MONTHNUMBER|Gearran}} returns 2
- {{MONTHNUMBER|Màrt}} returns 3
- {{MONTHNUMBER|Giblean}} returns 4
- {{MONTHNUMBER|Cèitean}} returns 5
- {{MONTHNUMBER|Òg-mhios}} returns 6
- {{MONTHNUMBER|Ògmhios}} returns 6
- {{MONTHNUMBER|Iuchar}} returns 7
- {{MONTHNUMBER|Lùnastal}} returns 8
- {{MONTHNUMBER|Sultain}} returns 9
- {{MONTHNUMBER|Sultaine}} returns 9
- {{MONTHNUMBER|Dàmhair}} returns 10
- {{MONTHNUMBER|Samhain}} returns 11
- {{MONTHNUMBER|Dùbhlachd}} returns 12
Examples for all abbreviated Gaelic month names
[deasaich]- {{MONTHNUMBER|Faoi}} returns 1
- {{MONTHNUMBER|Gearr}} returns 2
- {{MONTHNUMBER|Gear}} returns 2
- {{MONTHNUMBER|Màr}} returns 3
- {{MONTHNUMBER|Gibl}} returns 4
- {{MONTHNUMBER|Cèit}} returns 5
- {{MONTHNUMBER|Ògmh}} returns 6
- {{MONTHNUMBER|Iuch}} returns 7
- {{MONTHNUMBER|Lùna}} returns 8
- {{MONTHNUMBER|Lùn}} returns 8
- {{MONTHNUMBER|Sult}} returns 9
- {{MONTHNUMBER|Dàmh}} returns 10
- {{MONTHNUMBER|Samh}} returns 11
- {{MONTHNUMBER|Dùbh}} returns 12
Examples for all standard English month names
[deasaich]- {{MONTHNUMBER|January}} returns 1
- {{MONTHNUMBER|February}} returns 2
- {{MONTHNUMBER|March}} returns 3
- {{MONTHNUMBER|April}} returns 4
- {{MONTHNUMBER|May}} returns 5
- {{MONTHNUMBER|June}} returns 6
- {{MONTHNUMBER|July}} returns 7
- {{MONTHNUMBER|August}} returns 8
- {{MONTHNUMBER|September}} returns 9
- {{MONTHNUMBER|October}} returns 10
- {{MONTHNUMBER|November}} returns 11
- {{MONTHNUMBER|December}} returns 12
Examples for all abbreviated English month names
[deasaich]- {{MONTHNUMBER|Jan}} returns 1
- {{MONTHNUMBER|Feb}} returns 2
- {{MONTHNUMBER|Mar}} returns 3
- {{MONTHNUMBER|Apr}} returns 4
- {{MONTHNUMBER|May}} returns 5
- {{MONTHNUMBER|Jun}} returns 6
- {{MONTHNUMBER|Jul}} returns 7
- {{MONTHNUMBER|Aug}} returns 8
- {{MONTHNUMBER|Sep}} returns 9
- {{MONTHNUMBER|Oct}} returns 10
- {{MONTHNUMBER|Nov}} returns 11
- {{MONTHNUMBER|Dec}} returns 12
Examples for all standard month numbers
[deasaich]- {{MONTHNUMBER|1}} returns 1
- {{MONTHNUMBER|2}} returns 2
- {{MONTHNUMBER|3}} returns 3
- {{MONTHNUMBER|4}} returns 4
- {{MONTHNUMBER|5}} returns 5
- {{MONTHNUMBER|6}} returns 6
- {{MONTHNUMBER|7}} returns 7
- {{MONTHNUMBER|8}} returns 8
- {{MONTHNUMBER|9}} returns 9
- {{MONTHNUMBER|10}} returns 10
- {{MONTHNUMBER|11}} returns 11
- {{MONTHNUMBER|12}} returns 12
Examples for month numbers with extra leading zero
[deasaich]- {{MONTHNUMBER|01}} returns 1
- {{MONTHNUMBER|02}} returns 2
- {{MONTHNUMBER|03}} returns 3
- {{MONTHNUMBER|04}} returns 4
- {{MONTHNUMBER|05}} returns 5
- {{MONTHNUMBER|06}} returns 6
- {{MONTHNUMBER|07}} returns 7
- {{MONTHNUMBER|08}} returns 8
- {{MONTHNUMBER|09}} returns 9
Examples for month number underflows and overflows, from computed values
[deasaich]- {{MONTHNUMBER|-1200}} returns 12
- {{MONTHNUMBER|-1201}} returns 11
- {{MONTHNUMBER|-1212}} returns 12
- {{MONTHNUMBER|-12}} returns 12
- {{MONTHNUMBER|-11}} returns 1
- {{MONTHNUMBER|-10}} returns 2
- {{MONTHNUMBER|-9}} returns 3
- {{MONTHNUMBER|-8}} returns 4
- {{MONTHNUMBER|-7}} returns 5
- {{MONTHNUMBER|-6}} returns 6
- {{MONTHNUMBER|-5}} returns 7
- {{MONTHNUMBER|-4}} returns 8
- {{MONTHNUMBER|-3}} returns 9
- {{MONTHNUMBER|-2}} returns 10
- {{MONTHNUMBER|-1}} returns 11
- {{MONTHNUMBER|-0.9999}} returns 11
- {{MONTHNUMBER|-0.5}} returns 11
- {{MONTHNUMBER|-0.0001}} returns 11
- {{MONTHNUMBER|0}} returns 12
- {{MONTHNUMBER|0.0001}} returns 12
- {{MONTHNUMBER|0.5}} returns 12
- {{MONTHNUMBER|0.9999}} returns 12
- {{MONTHNUMBER|12.0001}} returns 12
- {{MONTHNUMBER|12.5}} returns 12
- {{MONTHNUMBER|12.9999}} returns 12
- {{MONTHNUMBER|13}} returns 1
- {{MONTHNUMBER|14}} returns 2
- {{MONTHNUMBER|24}} returns 12
- {{MONTHNUMBER|1200}} returns 12
- {{MONTHNUMBER|1201}} returns 1
- {{MONTHNUMBER|1212}} returns 12
Example for invalid month name
[deasaich]- {{MONTHNUMBER|xx}} returns Marachd eas-preisein: Chan aithne dhuinn am facal "xx".
Faic cuideachd - Also see
The above documentation is transcluded from Teamplaid:MONTHNUMBER/documentation. (edit | history) Editors can experiment in this template's sandbox (create | mirror) and testcases (create) pages. Please add categories to the /documentation subpage. Subpages of this template. |