Template:Weekday in month/doc

Usage
Note that the order of the input can be reversed. The following give the same output.
 * Code
 * y m w n
 * n w m y

Note that the year is optional. The following give the nth w-day of month m this year.
 * m w n
 * n w m


 * Parameters
 * Examples

Calculation
The template then gives j, the day of the month, as caclulated 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.