Difference between revisions of "Template:Month"

From comp.tf
Jump to navigation Jump to search
Line 1: Line 1:
 
<includeonly>{{#if:{{{2|}}}|{{#switch:{{lc:{{{2|}}}}}|
 
<includeonly>{{#if:{{{2|}}}|{{#switch:{{lc:{{{2|}}}}}|
 
   |num
 
   |num
   |number={{#switch:{{lc:{{{1|}}}}}|
+
   |number={{#switch:{{lc:{{{1|}}}}}
 
   |1|01|jan|january=01
 
   |1|01|jan|january=01
 
   |2|02|feb|february=02
 
   |2|02|feb|february=02
Line 14: Line 14:
 
   |11|nov|november=11
 
   |11|nov|november=11
 
   |11|dec|december=12
 
   |11|dec|december=12
}}}}|{{#switch:{{lc:{{{5|}}}}}|
+
}}}}|{{#switch:{{lc:{{{5|}}}}}
 
   |1|01|jan|january=January
 
   |1|01|jan|january=January
 
   |2|02|feb|february=February
 
   |2|02|feb|february=February

Revision as of 00:14, 16 April 2020

(view - edit) Documentation

This template converts numbers/abbreviations/full names of months into numbers or month names.

You type You get
{{month|1}}
{{month|02}}
{{month|mar}}
{{month|april}}

A second parameter may also be added. If set to num or number, the template will instead return the numberical value of the month.

You type You get
{{month|jan|num}} 01