Template:Days in month: Difference between revisions

From OLPC
Jump to navigation Jump to search
(01 v 1)
(..)
Line 7: Line 7:
Currently broken, since the switch isn't working.
Currently broken, since the switch isn't working.


:{{#switch:01|2|3|4=5|1=6|#default=35}}
:vanilla switch {{#switch:01|2|3|4=5|1=6|#default=35}}
:ifexpr {{#ifexpr:{{IsLeapYear|{{{year|{{CURRENTYEAR}}}}}}}|29|28}}
:month var {{{month|{{CURRENTMONTH}}}}}}}
:leapcheck {{#ifexpr:{{IsLeapYear|{{{year|{{CURRENTYEAR}}}}}}}
:switch new {{#switch:{{{month|{{CURRENTMONTH}}}}}|4|6|9|11=30|2={{#ifexpr:{{IsLeapYear|{{{year|{{CURRENTYEAR}}}}}}}|29|28}}|#default=31}}



See also [[Template:Age calculator]] and [[Template:IsLeapYear]].
See also [[Template:Age calculator]] and [[Template:IsLeapYear]].

Revision as of 03:49, 10 February 2008

31


Takes a month and year and returns the # of days in the month. Assumes current date if none is given. Currently broken, since the switch isn't working.

vanilla switch 6
ifexpr Expression error: Unrecognized punctuation character "[".
month var 11}}
leapcheck {{#ifexpr:1
switch new 30


See also Template:Age calculator and Template:IsLeapYear.