Changes

Jump to: navigation, search

Template:Days after date

1,894 bytes added, 01:53, 4 March 2019
Created page with "<noinclude> ==Usage== Returns the numerical day of the month relative to a given date. The first three parameters are the year, month name, and day number of a date which is..."
<noinclude>
==Usage==
Returns the numerical day of the month relative to a given date.

The first three parameters are the year, month name, and day number of a date which is taken as the start of a week.

The fourth parameter is a number from 1 to 7 representing the day of the week. The fourth parameter should be between 1 and 7.

==Example==

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

{{Days after date|2020|February|28|5}}
{{Days after date|2100|February|28|5}}
{{Days after date|2400|February|28|5}}
</nowiki></pre>

Produces:

{{Days after date|2019|January|28|5}}
{{Days after date|2019|February|28|5}}
{{Days after date|2019|March|28|5}}
{{Days after date|2019|April|28|5}}
{{Days after date|2019|May|28|5}}
{{Days after date|2019|June|28|5}}
{{Days after date|2019|July|28|5}}
{{Days after date|2019|August|28|5}}
{{Days after date|2019|September|28|5}}
{{Days after date|2019|October|28|5}}
{{Days after date|2019|November|28|5}}
{{Days after date|2019|December|28|5}}

{{Days after date|2020|February|28|5}}
{{Days after date|2100|February|28|5}}
{{Days after date|2400|February|28|5}}

</noinclude><includeonly><!-- The calculation is ((day of month + day of week - 2) mod (days in month)) + 1
-->{{#expr:(({{{3}}} + {{{4}}} - 2) mod (<!--
-->{{#switch:{{{2}}}
|April |June |September |November=30
|February=({{#ifexpr:((({{{1}}} mod 4) > 0) or ((({{{1}}} mod 100) = 0) and (({{{1}}} mod 400) > 0)))|28|29}})
|31}})) + 1}}</includeonly>

Navigation menu