Jump to content

Template:Weekday after date/doc

From Wikipedia, the free encyclopedia

This is the current revision of this page, as edited by Quantling (talk | contribs) at 15:14, 5 December 2023 (Changing example date to a date commensurate with the template's creation). The present address (URL) is a permanent link to this version.

(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)

Usage

[edit]

{{Weekday after date|Y|M|D|W|S}} 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

[edit]

The first Sunday after August 18, 2024 is given by "{{Weekday after date|2024|August|18|Sunday}}" as "August 25, 2024".

In the following table, 24 October 2010 is a Sunday.

Syntax What it looks like Notes
{{Weekday after date|2010|October|24|Monday|d F Y}} 25 October 2010
{{Weekday after date|2010|October|24|Tuesday|d F Y}} 26 October 2010
{{Weekday after date|2010|October|24|Wednesday|d F Y}} 27 October 2010
{{Weekday after date|2010|October|24|Thursday|Y-m-d}} 2010-10-28
{{Weekday after date|2010|October|24|Friday|Y-m-d}} 2010-10-29
{{Weekday after date|2010|October|24|Saturday|d F Y}} 30 October 2010
{{Weekday after date|2010|October|24|Sunday|d F Y}} 31 October 2010 When a starting date falls on the specified weekday, the resulting date will be one week later.
{{Weekday after date|2010|10|24|Thursday|d F Y}} Error: Invalid time. Numeric month results in error

See also

[edit]