Changes

Jump to: navigation, search

Template:Days in month

1,352 bytes added, 02:39, 4 March 2019
Created page with "<noinclude> ==Usage== Returns the number of days in the given month. The first parameter is the month name. The second parameter is the year. ==Example== The following sho..."
<noinclude>
==Usage==
Returns the number of days in the given month.

The first parameter is the month name.

The second parameter is the year.

==Example==

The following shorthand:
<pre><nowiki>
{{Days in month|January|2019}}
{{Days in month|February|2019}}
{{Days in month|March|2019}}
{{Days in month|April|2019}}
{{Days in month|May|2019}}
{{Days in month|June|2019}}
{{Days in month|July|2019}}
{{Days in month|August|2019}}
{{Days in month|September|2019}}
{{Days in month|October|2019}}
{{Days in month|November|2019}}
{{Days in month|December|2019}}

{{Days in month|February|2020}}
{{Days in month|February|2100}}
{{Days in month|February|2400}}
</nowiki></pre>

Produces:

{{Days in month|January|2019}}
{{Days in month|February|2019}}
{{Days in month|March|2019}}
{{Days in month|April|2019}}
{{Days in month|May|2019}}
{{Days in month|June|2019}}
{{Days in month|July|2019}}
{{Days in month|August|2019}}
{{Days in month|September|2019}}
{{Days in month|October|2019}}
{{Days in month|November|2019}}
{{Days in month|December|2019}}

{{Days in month|February|2020}}
{{Days in month|February|2100}}
{{Days in month|February|2400}}

</noinclude><includeonly>{{#switch:{{{1}}}
|April |June |September |November=30
|February={{#ifexpr:((({{{2}}} mod 4) > 0) or ((({{{2}}} mod 100) = 0) and (({{{2}}} mod 400) > 0)))|28|29}}
|31}}</includeonly>

Navigation menu