Template:Days in month: Difference between revisions

From OLPC
Jump to navigation Jump to search
(..)
(just check)
Line 8: Line 8:


:vanilla switch {{#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}}
:ifexpr leap year {{#ifexpr:{{IsLeapYear|{{{year|{{CURRENTYEAR}}}}}}}
:month var {{{month|{{CURRENTMONTH}}}}}}}
:month var {{{month|{{CURRENTMONTH}}}}}}}
:leapcheck {{#ifexpr:{{IsLeapYear|{{{year|{{CURRENTYEAR}}}}}}}
:leapcheck {{#ifexpr:{{IsLeapYear|{{{year|{{CURRENTYEAR}}}}}}}}}
:switch new {{#switch:{{{month|{{CURRENTMONTH}}}}}|4|6|9|11=30|2={{#ifexpr:{{IsLeapYear|{{{year|{{CURRENTYEAR}}}}}}}|29|28}}|#default=31}}
:switch new {{#switch:{{{month|{{CURRENTMONTH}}}}}|4|6|9|11=30|2={{#ifexpr:{{IsLeapYear|{{{year|{{CURRENTYEAR}}}}}}}|29|28}}|#default=31}}



Revision as of 03:50, 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 leap year Expression error: Unrecognized punctuation character "[".
leapcheck Expression error: Unrecognized punctuation character "[".
switch new 30


See also Template:Age calculator and Template:IsLeapYear.