Template:DatesWD
Appearance
Usage
[edit]This template uses Lua: |
An asterisk "*" marks non-specified parameters, and which in this case are taken equal to their current values.
{{DatesWD|1}}
gives first Saturday* in December* of 2024* — 2024-12-07{{DatesWD|2|4}}
gives second Thursday in December* of 2024* — 2024-12-12{{DatesWD|-1|0|12|date=wiki}}
gives last Sunday in December of 2024* in a short wiki link format — December 29{{DatesWD|4|3|9|2011|format=%a %d %b %Y}}
gives fourth Wednesday in September of 2011 in some #Lua date format — Wed 28 Sep 2011{{DatesWD|1|2|3|date=1}}
gives first Tuesday of March in next year — March 04, 2025{{DatesWD|3|5|2|date=-1}}
gives third Friday of February in last year — February 17, 2023{{DatesWD|-2|6|7|{{#expr:{{CURRENTYEAR}}-1}}|date=wiki_long}}
gives penultimate Saturday in July for last year in a long wiki link format — June 17, 2023
Lua date format
[edit]If you use the |date=
parameter, then this format does not work.
- %a abbreviated weekday name (e.g., Wed)
- %A full weekday name (e.g., Wednesday)
- %b abbreviated month name (e.g., Sep)
- %B full month name (e.g., September)
- %x date (e.g., 09/16/98)
- %d day of the month (16) [01-31]
- %m month (09) [01-12]
- %w weekday (3) [0-6 = Sunday-Saturday]
- %Y full year (1998)
- %y two-digit year (98) [00-99]
Template Data
[edit]Calculation of non-fixed dates on the nth day of the week in a given month (and a year).
Parameter | Description | Type | Status | |
---|---|---|---|---|
Nth | 1 | 1 = first, 2 = second, etc. -1 = last, -2 = penultimate, etc
| Number | required |
Day of the week | 2 | 0 = Sunday, 1 = Monday, ... 6 = Saturday
| Number | suggested |
Month | 3 | 1 = January, 2 = February, ... 12 = December
| Number | suggested |
Year | 4 | Fore digits year
| Number | optional |
Wiki date output formats | date | MD/wiki for [[January 1]] format, MDY/wiki_long for [[December 31, 2018]] format | Line | optional |
Lua output format | format | %x for date format MM/DD/YY or others, default YYYY-MM-DD
| Line | optional |