قالب:Weekday in month/sandbox
![]() | This is the template sandbox page for قالب:Weekday in month (diff). |
Usage
- Code
Note that the order of the input can be reversed. The following give the same output.
{{Weekday in month|
y|
m|
w|
n}}
{{Weekday in month|
n|
w|
m|
y}}
Note that the year is optional. The following give the nth w-day of month m this year.
{{Weekday in month||
m|
w|
n}}
{{Weekday in month|
n|
w|
m}}
- Parameters
y | year | numeric format, certain words, blank
|
---|---|---|
m | month | numeric format, spelt out in full or abbreviated
|
w | weekday | numeric format, spelt out in full or abbreviated
|
n | count | numeric format, spelt out in full or abbreviated
|
- Examples
|
|
|
Calculation
The template then gives j, the day of the month, as calculated by the following formulae.
- j = 7×n − 6 + (w − w1) mod 7 (for positive n)
- j = t + 7×(n + 1) − (wt − w) mod 7 (for negative n)
Where t is the last day of the month, wt is the ISO weekday number of the last day of the month, w1 is the ISO weekday number of the first day of the month and n and w are as defined above.
Examples
year | MLK Jr Day (US) | Presidents Day (US) | Memorial Day (US) | Labor Day (US) | Columbus Day (US) | Father's Day (Australia) |
Mother's Day (many countries) |
Thanksgiving (Norfolk Island) |
Melbourne Cup Day (Australia) |
---|---|---|---|---|---|---|---|---|---|
3rd Monday in January | 3rd Monday in February | Last Monday in May | 1st Monday in September | 2nd Monday in October | 1st Sunday in September | 2nd Sunday in May | last Wednesday of November | first Tuesday in November | |
2019 | 21 January | 18 February | 27 May | 2 September | 14 October | 6 September | 12 May | 27 November | 5 November |
{{weekday in month
|
{{weekday in month
|
{{weekday in month
|
{{weekday in month
|
{{weekday in month
|
{{weekday in month
|
{{weekday in month
|
{{weekday in month
|
{{weekday in month
| |
2020 | 20 January | 17 February | 25 May | 7 September | 12 October | 4 September | 10 May | 25 November | 3 November |
{{weekday in month
|
{{weekday in month
|
{{weekday in month
|
{{weekday in month
|
{{weekday in month
|
{{weekday in month
|
{{weekday in month
|
{{weekday in month
|
{{weekday in month
| |
2021 | 18 January | 15 February | 31 May | 6 September | 11 October | 3 September | 9 May | 24 November | 2 November |
{{weekday in month
|
{{weekday in month
|
{{weekday in month
|
{{weekday in month
|
{{weekday in month
|
{{weekday in month
|
{{weekday in month
|
{{weekday in month
|
{{weekday in month
| |
2022 | 17 January | 21 February | 30 May | 5 September | 10 October | 2 September | 8 May | 30 November | 1 November |
{{weekday in month
|
{{weekday in month
|
{{weekday in month
|
{{weekday in month
|
{{weekday in month
|
{{weekday in month
|
{{weekday in month
|
{{weekday in month
|
{{weekday in month
| |
2023 (last year) |
16 January | 20 February | 29 May | 4 September | 9 October | 1 September | 14 May | 29 November | 7 November |
{{weekday in month
|
{{weekday in month
|
{{weekday in month
|
{{weekday in month
|
{{weekday in month
|
{{weekday in month
|
{{weekday in month
|
{{weekday in month
|
{{weekday in month
| |
2024 (this year) |
15 January | 19 February | 27 May | 2 September | 14 October | 6 September | 12 May | 27 November | 5 November |
{{weekday in month
|
{{weekday in month
|
{{weekday in month
|
{{weekday in month
|
{{weekday in month
|
{{weekday in month
|
{{weekday in month
|
{{weekday in month
|
{{weekday in month
| |
2025 (next year) |
20 January | 17 February | 26 May | 1 September | 13 October | 5 September | 11 May | 26 November | 4 November |
{{weekday in month
|
{{weekday in month
|
{{weekday in month
|
{{weekday in month
|
{{weekday in month
|
{{weekday in month
|
{{weekday in month
|
{{weekday in month
|
{{weekday in month
|
See also
- {{WEEKDAY}}
- {{Weekday in month elapsed}}
The above documentation is transcluded from قالب:Weekday in month/doc. (edit | history) Editors can experiment in this template's sandbox (edit | diff) and testcases (create) pages. Please add categories to the /doc subpage. Subpages of this template. |