Changes
simulate error message to remove page from Category:Pages with parser function time errors
{{Documentation subpage}}
<!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see [[Wikipedia:Wikidata]]) -->
== Usage ==
<nowiki>{{Weekday after date|Y|M|D|W|S}}</nowiki> uses the optional date format string S (defaults to "F d, Y") to return the date of the first W (=Sunday, Monday, ..., Saturday) after the specified date with year Y, month M (spelled out), and day of month D.
==Examples==
The first Sunday after {{CURRENTMONTHNAME}} {{CURRENTDAY}}, {{CURRENTYEAR}} is given by "<nowiki>{{Weekday after date|</nowiki>{{CURRENTYEAR}}|{{CURRENTMONTHNAME}}|{{CURRENTDAY}}<nowiki>|Sunday}}</nowiki>" as "{{Weekday after date|{{CURRENTYEAR}}|{{CURRENTMONTHNAME}}|{{CURRENTDAY}}|Sunday}}".
In the following table, 25 May 2014 is a Sunday.
{| class="wikitable"
|-
! Syntax
! What it looks like
! width="20%" align="center" | '''Notes'''
|-
|<code><nowiki>{{Weekday after date|2014|May|25|Monday|d F Y}}</nowiki></code>
|{{Weekday after date|2014|May|25|Monday|d F Y}}
|
|-
|<code><nowiki>{{Weekday after date|2014|May|25|Tuesday|d F Y}}</nowiki></code>
|{{Weekday after date|2014|May|25|Tuesday|d F Y}}
|
|-
|<code><nowiki>{{Weekday after date|2014|May|25|Wednesday|d F Y}}</nowiki></code>
|{{Weekday after date|2014|May|25|Wednesday|d F Y}}
|
|-
|<code><nowiki>{{Weekday after date|2014|May|25|Thursday|Y-m-d}}</nowiki></code>
|{{Weekday after date|2014|May|25|Thursday|Y-m-d}}
|
|-
|<code><nowiki>{{Weekday after date|2014|May|25|Friday|Y-m-d}}</nowiki></code>
|{{Weekday after date|2014|May|25|Friday|Y-m-d}}
|
|-
|<code><nowiki>{{Weekday after date|2014|May|25|Saturday|d F Y}}</nowiki></code>
|{{Weekday after date|2014|May|25|Saturday|d F Y}}
|
|-
|<code><nowiki>{{Weekday after date|2014|May|25|Sunday|d F Y}}</nowiki></code>
|{{Weekday after date|2014|May|25|Sunday|d F Y}}
|When a starting date falls on the specified weekday, the resulting date will be one week later.
|-
|<code><nowiki>{{Weekday after date|2014|05|25|Thursday|d F Y}}</nowiki></code>
|<strong class="error">Error: Invalid time.</strong>
|Numeric month results in error
|}
== See also ==
* [[Template:Weekday before date]]
<includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox | |
<!-- Categories below this line, please; interwikis at Wikidata -->
[[Category:Date-computing templates]]
}}</includeonly>
<!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see [[Wikipedia:Wikidata]]) -->
== Usage ==
<nowiki>{{Weekday after date|Y|M|D|W|S}}</nowiki> uses the optional date format string S (defaults to "F d, Y") to return the date of the first W (=Sunday, Monday, ..., Saturday) after the specified date with year Y, month M (spelled out), and day of month D.
==Examples==
The first Sunday after {{CURRENTMONTHNAME}} {{CURRENTDAY}}, {{CURRENTYEAR}} is given by "<nowiki>{{Weekday after date|</nowiki>{{CURRENTYEAR}}|{{CURRENTMONTHNAME}}|{{CURRENTDAY}}<nowiki>|Sunday}}</nowiki>" as "{{Weekday after date|{{CURRENTYEAR}}|{{CURRENTMONTHNAME}}|{{CURRENTDAY}}|Sunday}}".
In the following table, 25 May 2014 is a Sunday.
{| class="wikitable"
|-
! Syntax
! What it looks like
! width="20%" align="center" | '''Notes'''
|-
|<code><nowiki>{{Weekday after date|2014|May|25|Monday|d F Y}}</nowiki></code>
|{{Weekday after date|2014|May|25|Monday|d F Y}}
|
|-
|<code><nowiki>{{Weekday after date|2014|May|25|Tuesday|d F Y}}</nowiki></code>
|{{Weekday after date|2014|May|25|Tuesday|d F Y}}
|
|-
|<code><nowiki>{{Weekday after date|2014|May|25|Wednesday|d F Y}}</nowiki></code>
|{{Weekday after date|2014|May|25|Wednesday|d F Y}}
|
|-
|<code><nowiki>{{Weekday after date|2014|May|25|Thursday|Y-m-d}}</nowiki></code>
|{{Weekday after date|2014|May|25|Thursday|Y-m-d}}
|
|-
|<code><nowiki>{{Weekday after date|2014|May|25|Friday|Y-m-d}}</nowiki></code>
|{{Weekday after date|2014|May|25|Friday|Y-m-d}}
|
|-
|<code><nowiki>{{Weekday after date|2014|May|25|Saturday|d F Y}}</nowiki></code>
|{{Weekday after date|2014|May|25|Saturday|d F Y}}
|
|-
|<code><nowiki>{{Weekday after date|2014|May|25|Sunday|d F Y}}</nowiki></code>
|{{Weekday after date|2014|May|25|Sunday|d F Y}}
|When a starting date falls on the specified weekday, the resulting date will be one week later.
|-
|<code><nowiki>{{Weekday after date|2014|05|25|Thursday|d F Y}}</nowiki></code>
|<strong class="error">Error: Invalid time.</strong>
|Numeric month results in error
|}
== See also ==
* [[Template:Weekday before date]]
<includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox | |
<!-- Categories below this line, please; interwikis at Wikidata -->
[[Category:Date-computing templates]]
}}</includeonly>