Template:Days in month: Difference between revisions

From OLPC
Jump to navigation Jump to search
(nice.)
(#ifdef broken within #switch; workaround)
Line 1: Line 1:
{{#switch:{{{month|{{CURRENTMONTH}}}}|4|6|9|11=30|2={{#switch:{{IsLeapYear|{{{year|{{CURRENTYEAR}}}}}}}|1=29|28}}|#default=31}}<!--
{{#switch:{{{month|{{CURRENTMONTH}}}}}|4|6|9|11=30|2={{#switch:{{IsLeapYear|{{{year|{{CURRENTYEAR}}}}}}}|1=29|28}}|#default=31}}<!--


--><noinclude>
--><noinclude>

Revision as of 04:02, 10 February 2008

30


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.

month 11 year 2024
current : {Template:Month
vanilla switch 6
isleapyear 1
ifcheck 1
leapcheck 28
switch new 30


See also Template:Age calculator and Template:IsLeapYear.