Changes

Jump to: navigation, search

Template:Date after date

2,107 bytes added, 09:32, 1 April 2019
Created page with "<noinclude> ==Usage== Returns a comma-separated date string of Year,Month,Day, a given number of days after a given start-of-week date. The first three parameters are the yea..."
<noinclude>
==Usage==
Returns a comma-separated date string of Year,Month,Day, a given number of days after a given start-of-week 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.

See also [[Template:Day after date]].

==Example==

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

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

Produces:

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

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

</noinclude><includeonly>
{{#ifexpr: {{{3}}} + {{{4}}} - 1 <= {{Days in month|{{{2}}}|{{{1}}}}}|<!-- If date lies within the same month:
-->{{{1}}},{{{2}}},{{#expr:{{{3}}} + {{{4}}} - 1}}|<!-- Same year and month, different day. Otherwise:
-->{{#expr:{{{1}}} + {{#ifeq:{{{2}}}|December|1|0}}}},<!-- Year (+1 if move from Dec to Jan)
-->{{Next month|{{{2}}}}},<!-- Month (+1)
-->{{Days after date|{{{1}}}|{{{2}}}|{{{3}}}|{{{4}}}}}<!-- Day (+ number of days)
-->}}</includeonly>

Navigation menu