.

Template:WEEKDAYNUMBER/doc

Wikicars, a place to share your automotive knowledge
Jump to navigationJump to search
Error creating thumbnail: Unable to save thumbnail to destination
This is a documentation subpage for WEEKDAYNUMBER/doc (see that page for the template or article itself).
It contains usage information, categories, interlanguage links and other content that is not part of the original page.


This template returns the cyclic integer weekday number (between 0 and 6) of the date whose number is in parameter. Alternatively, the day can be given with its English weekday name (complete or abbreviated to 3 characters, with capitals or small letters).

Syntax:
{{WEEKDAYNUMBER|day}}
  • The day value can be any numeric expression and is interpreted modulo 7 (extra leading zeroes and decimals are ignored), so it accepts any valid julian day timestamp.
Example with a julian day timestamp:
{{WEEKDAYNUMBER|{{JULIANDAY|2000|01|01}}}} returns {{#if:{{#if:2000|{{#expr:((((2000)*12+(01)+57608.5 round 0)/12-1.5 round 0)*1461/4-0.5 round 0)-((((2000)*12+(01)+57608.5 round 0)/12-1.5 round 0)/100-0.5 round 0)+((((2000)*12+(01)+57608.5 round 0)/12-1.5 round 0)/400-0.5 round 0)+((((01)+57608.5 round 0)mod 12+4)*153/5-0.5 round 0)+(01)+(12)/24+(0)/1440+(0)/86400-32167.5}}|Parameter 1=year required!}}|{{#switch:{{#if:2000|{{#expr:((((2000)*12+(01)+57608.5 round 0)/12-1.5 round 0)*1461/4-0.5 round 0)-((((2000)*12+(01)+57608.5 round 0)/12-1.5 round 0)/100-0.5 round 0)+((((2000)*12+(01)+57608.5 round 0)/12-1.5 round 0)/400-0.5 round 0)+((((01)+57608.5 round 0)mod 12+4)*153/5-0.5 round 0)+(01)+(12)/24+(0)/1440+(0)/86400-32167.5}}|parameter 1=year required!}}|monday|mon=0|tuesday|tue=1|wednesday|wed=2|thursday|thu=3|friday|fri=4|saturday|sat=5|sunday|sun=6|{{#ifexpr:{{#if:2000|{{#expr:((((2000)*12+(01)+57608.5 round 0)/12-1.5 round 0)*1461/4-0.5 round 0)-((((2000)*12+(01)+57608.5 round 0)/12-1.5 round 0)/100-0.5 round 0)+((((2000)*12+(01)+57608.5 round 0)/12-1.5 round 0)/400-0.5 round 0)+((((01)+57608.5 round 0)mod 12+4)*153/5-0.5 round 0)+(01)+(12)/24+(0)/1440+(0)/86400-32167.5}}|Parameter 1=year required!}}<0|{{#ifexpr:(({{#if:2000|{{#expr:((((2000)*12+(01)+57608.5 round 0)/12-1.5 round 0)*1461/4-0.5 round 0)-((((2000)*12+(01)+57608.5 round 0)/12-1.5 round 0)/100-0.5 round 0)+((((2000)*12+(01)+57608.5 round 0)/12-1.5 round 0)/400-0.5 round 0)+((((01)+57608.5 round 0)mod 12+4)*153/5-0.5 round 0)+(01)+(12)/24+(0)/1440+(0)/86400-32167.5}}|Parameter 1=year required!}})round 0)!=({{#if:2000|{{#expr:((((2000)*12+(01)+57608.5 round 0)/12-1.5 round 0)*1461/4-0.5 round 0)-((((2000)*12+(01)+57608.5 round 0)/12-1.5 round 0)/100-0.5 round 0)+((((2000)*12+(01)+57608.5 round 0)/12-1.5 round 0)/400-0.5 round 0)+((((01)+57608.5 round 0)mod 12+4)*153/5-0.5 round 0)+(01)+(12)/24+(0)/1440+(0)/86400-32167.5}}|Parameter 1=year required!}})|{{#expr:6-(((6.5-({{#if:2000|{{#expr:((((2000)*12+(01)+57608.5 round 0)/12-1.5 round 0)*1461/4-0.5 round 0)-((((2000)*12+(01)+57608.5 round 0)/12-1.5 round 0)/100-0.5 round 0)+((((2000)*12+(01)+57608.5 round 0)/12-1.5 round 0)/400-0.5 round 0)+((((01)+57608.5 round 0)mod 12+4)*153/5-0.5 round 0)+(01)+(12)/24+(0)/1440+(0)/86400-32167.5}}|Parameter 1=year required!}}))round 0)mod 7)}}|{{#expr:6-(((5.5-({{#if:2000|{{#expr:((((2000)*12+(01)+57608.5 round 0)/12-1.5 round 0)*1461/4-0.5 round 0)-((((2000)*12+(01)+57608.5 round 0)/12-1.5 round 0)/100-0.5 round 0)+((((2000)*12+(01)+57608.5 round 0)/12-1.5 round 0)/400-0.5 round 0)+((((01)+57608.5 round 0)mod 12+4)*153/5-0.5 round 0)+(01)+(12)/24+(0)/1440+(0)/86400-32167.5}}|Parameter 1=year required!}}))round 0)mod 7)}}}}|{{#expr:(((6.5+{{#if:2000|{{#expr:((((2000)*12+(01)+57608.5 round 0)/12-1.5 round 0)*1461/4-0.5 round 0)-((((2000)*12+(01)+57608.5 round 0)/12-1.5 round 0)/100-0.5 round 0)+((((2000)*12+(01)+57608.5 round 0)/12-1.5 round 0)/400-0.5 round 0)+((((01)+57608.5 round 0)mod 12+4)*153/5-0.5 round 0)+(01)+(12)/24+(0)/1440+(0)/86400-32167.5}}|Parameter 1=year required!}})round 0)mod 7)}}}}}}|Missing required parameter 1=day!}}

.

Note:
The returned value is ordered from 0 to 6 according to the ISO week (Monday to Sunday), and is consistent with date computing with julian day, ISO week or ISO year computations. Use another template to convert it to traditional US week numbers, by adding 5, reducing the result with modulo 7 and, if needed, adding 1 to the result for a range between 1 and 7.
Examples for all standard English week day names:
{{WEEKDAYNUMBER|monday}} returns {{#if:monday|{{#switch:monday|monday|mon=0|tuesday|tue=1|wednesday|wed=2|thursday|thu=3|friday|fri=4|saturday|sat=5|sunday|sun=6|{{#ifexpr:monday<0|{{#ifexpr:((monday)round 0)!=(monday)|{{#expr:6-(((6.5-(monday))round 0)mod 7)}}|{{#expr:6-(((5.5-(monday))round 0)mod 7)}}}}|{{#expr:(((6.5+monday)round 0)mod 7)}}}}}}|Missing required parameter 1=day!}}
{{WEEKDAYNUMBER|tuesday}} returns {{#if:tuesday|{{#switch:tuesday|monday|mon=0|tuesday|tue=1|wednesday|wed=2|thursday|thu=3|friday|fri=4|saturday|sat=5|sunday|sun=6|{{#ifexpr:tuesday<0|{{#ifexpr:((tuesday)round 0)!=(tuesday)|{{#expr:6-(((6.5-(tuesday))round 0)mod 7)}}|{{#expr:6-(((5.5-(tuesday))round 0)mod 7)}}}}|{{#expr:(((6.5+tuesday)round 0)mod 7)}}}}}}|Missing required parameter 1=day!}}
{{WEEKDAYNUMBER|wednesday}} returns {{#if:wednesday|{{#switch:wednesday|monday|mon=0|tuesday|tue=1|wednesday|wed=2|thursday|thu=3|friday|fri=4|saturday|sat=5|sunday|sun=6|{{#ifexpr:wednesday<0|{{#ifexpr:((wednesday)round 0)!=(wednesday)|{{#expr:6-(((6.5-(wednesday))round 0)mod 7)}}|{{#expr:6-(((5.5-(wednesday))round 0)mod 7)}}}}|{{#expr:(((6.5+wednesday)round 0)mod 7)}}}}}}|Missing required parameter 1=day!}}
{{WEEKDAYNUMBER|thursday}} returns {{#if:thursday|{{#switch:thursday|monday|mon=0|tuesday|tue=1|wednesday|wed=2|thursday|thu=3|friday|fri=4|saturday|sat=5|sunday|sun=6|{{#ifexpr:thursday<0|{{#ifexpr:((thursday)round 0)!=(thursday)|{{#expr:6-(((6.5-(thursday))round 0)mod 7)}}|{{#expr:6-(((5.5-(thursday))round 0)mod 7)}}}}|{{#expr:(((6.5+thursday)round 0)mod 7)}}}}}}|Missing required parameter 1=day!}}
{{WEEKDAYNUMBER|friday}} returns {{#if:friday|{{#switch:friday|monday|mon=0|tuesday|tue=1|wednesday|wed=2|thursday|thu=3|friday|fri=4|saturday|sat=5|sunday|sun=6|{{#ifexpr:friday<0|{{#ifexpr:((friday)round 0)!=(friday)|{{#expr:6-(((6.5-(friday))round 0)mod 7)}}|{{#expr:6-(((5.5-(friday))round 0)mod 7)}}}}|{{#expr:(((6.5+friday)round 0)mod 7)}}}}}}|Missing required parameter 1=day!}}
{{WEEKDAYNUMBER|saturday}} returns {{#if:saturday|{{#switch:saturday|monday|mon=0|tuesday|tue=1|wednesday|wed=2|thursday|thu=3|friday|fri=4|saturday|sat=5|sunday|sun=6|{{#ifexpr:saturday<0|{{#ifexpr:((saturday)round 0)!=(saturday)|{{#expr:6-(((6.5-(saturday))round 0)mod 7)}}|{{#expr:6-(((5.5-(saturday))round 0)mod 7)}}}}|{{#expr:(((6.5+saturday)round 0)mod 7)}}}}}}|Missing required parameter 1=day!}}
{{WEEKDAYNUMBER|sunday}} returns {{#if:sunday|{{#switch:sunday|monday|mon=0|tuesday|tue=1|wednesday|wed=2|thursday|thu=3|friday|fri=4|saturday|sat=5|sunday|sun=6|{{#ifexpr:sunday<0|{{#ifexpr:((sunday)round 0)!=(sunday)|{{#expr:6-(((6.5-(sunday))round 0)mod 7)}}|{{#expr:6-(((5.5-(sunday))round 0)mod 7)}}}}|{{#expr:(((6.5+sunday)round 0)mod 7)}}}}}}|Missing required parameter 1=day!}}


Examples for all abbreviated English week day names:
{{WEEKDAYNUMBER|mon}} returns {{#if:mon|{{#switch:mon|monday|mon=0|tuesday|tue=1|wednesday|wed=2|thursday|thu=3|friday|fri=4|saturday|sat=5|sunday|sun=6|{{#ifexpr:mon<0|{{#ifexpr:((mon)round 0)!=(mon)|{{#expr:6-(((6.5-(mon))round 0)mod 7)}}|{{#expr:6-(((5.5-(mon))round 0)mod 7)}}}}|{{#expr:(((6.5+mon)round 0)mod 7)}}}}}}|Missing required parameter 1=day!}}
{{WEEKDAYNUMBER|tue}} returns {{#if:tue|{{#switch:tue|monday|mon=0|tuesday|tue=1|wednesday|wed=2|thursday|thu=3|friday|fri=4|saturday|sat=5|sunday|sun=6|{{#ifexpr:tue<0|{{#ifexpr:((tue)round 0)!=(tue)|{{#expr:6-(((6.5-(tue))round 0)mod 7)}}|{{#expr:6-(((5.5-(tue))round 0)mod 7)}}}}|{{#expr:(((6.5+tue)round 0)mod 7)}}}}}}|Missing required parameter 1=day!}}
{{WEEKDAYNUMBER|wed}} returns {{#if:wed|{{#switch:wed|monday|mon=0|tuesday|tue=1|wednesday|wed=2|thursday|thu=3|friday|fri=4|saturday|sat=5|sunday|sun=6|{{#ifexpr:wed<0|{{#ifexpr:((wed)round 0)!=(wed)|{{#expr:6-(((6.5-(wed))round 0)mod 7)}}|{{#expr:6-(((5.5-(wed))round 0)mod 7)}}}}|{{#expr:(((6.5+wed)round 0)mod 7)}}}}}}|Missing required parameter 1=day!}}
{{WEEKDAYNUMBER|thu}} returns {{#if:thu|{{#switch:thu|monday|mon=0|tuesday|tue=1|wednesday|wed=2|thursday|thu=3|friday|fri=4|saturday|sat=5|sunday|sun=6|{{#ifexpr:thu<0|{{#ifexpr:((thu)round 0)!=(thu)|{{#expr:6-(((6.5-(thu))round 0)mod 7)}}|{{#expr:6-(((5.5-(thu))round 0)mod 7)}}}}|{{#expr:(((6.5+thu)round 0)mod 7)}}}}}}|Missing required parameter 1=day!}}
{{WEEKDAYNUMBER|fri}} returns {{#if:fri|{{#switch:fri|monday|mon=0|tuesday|tue=1|wednesday|wed=2|thursday|thu=3|friday|fri=4|saturday|sat=5|sunday|sun=6|{{#ifexpr:fri<0|{{#ifexpr:((fri)round 0)!=(fri)|{{#expr:6-(((6.5-(fri))round 0)mod 7)}}|{{#expr:6-(((5.5-(fri))round 0)mod 7)}}}}|{{#expr:(((6.5+fri)round 0)mod 7)}}}}}}|Missing required parameter 1=day!}}
{{WEEKDAYNUMBER|sat}} returns {{#if:sat|{{#switch:sat|monday|mon=0|tuesday|tue=1|wednesday|wed=2|thursday|thu=3|friday|fri=4|saturday|sat=5|sunday|sun=6|{{#ifexpr:sat<0|{{#ifexpr:((sat)round 0)!=(sat)|{{#expr:6-(((6.5-(sat))round 0)mod 7)}}|{{#expr:6-(((5.5-(sat))round 0)mod 7)}}}}|{{#expr:(((6.5+sat)round 0)mod 7)}}}}}}|Missing required parameter 1=day!}}
{{WEEKDAYNUMBER|sun}} returns {{#if:sun|{{#switch:sun|monday|mon=0|tuesday|tue=1|wednesday|wed=2|thursday|thu=3|friday|fri=4|saturday|sat=5|sunday|sun=6|{{#ifexpr:sun<0|{{#ifexpr:((sun)round 0)!=(sun)|{{#expr:6-(((6.5-(sun))round 0)mod 7)}}|{{#expr:6-(((5.5-(sun))round 0)mod 7)}}}}|{{#expr:(((6.5+sun)round 0)mod 7)}}}}}}|Missing required parameter 1=day!}}


Examples for all standard week day numbers:
{{WEEKDAYNUMBER|0}} returns {{#if:0|{{#switch:0|monday|mon=0|tuesday|tue=1|wednesday|wed=2|thursday|thu=3|friday|fri=4|saturday|sat=5|sunday|sun=6|{{#ifexpr:0<0|{{#ifexpr:((0)round 0)!=(0)|{{#expr:6-(((6.5-(0))round 0)mod 7)}}|{{#expr:6-(((5.5-(0))round 0)mod 7)}}}}|{{#expr:(((6.5+0)round 0)mod 7)}}}}}}|Missing required parameter 1=day!}}
{{WEEKDAYNUMBER|1}} returns {{#if:1|{{#switch:1|monday|mon=0|tuesday|tue=1|wednesday|wed=2|thursday|thu=3|friday|fri=4|saturday|sat=5|sunday|sun=6|{{#ifexpr:1<0|{{#ifexpr:((1)round 0)!=(1)|{{#expr:6-(((6.5-(1))round 0)mod 7)}}|{{#expr:6-(((5.5-(1))round 0)mod 7)}}}}|{{#expr:(((6.5+1)round 0)mod 7)}}}}}}|Missing required parameter 1=day!}}
{{WEEKDAYNUMBER|2}} returns {{#if:2|{{#switch:2|monday|mon=0|tuesday|tue=1|wednesday|wed=2|thursday|thu=3|friday|fri=4|saturday|sat=5|sunday|sun=6|{{#ifexpr:2<0|{{#ifexpr:((2)round 0)!=(2)|{{#expr:6-(((6.5-(2))round 0)mod 7)}}|{{#expr:6-(((5.5-(2))round 0)mod 7)}}}}|{{#expr:(((6.5+2)round 0)mod 7)}}}}}}|Missing required parameter 1=day!}}
{{WEEKDAYNUMBER|3}} returns {{#if:3|{{#switch:3|monday|mon=0|tuesday|tue=1|wednesday|wed=2|thursday|thu=3|friday|fri=4|saturday|sat=5|sunday|sun=6|{{#ifexpr:3<0|{{#ifexpr:((3)round 0)!=(3)|{{#expr:6-(((6.5-(3))round 0)mod 7)}}|{{#expr:6-(((5.5-(3))round 0)mod 7)}}}}|{{#expr:(((6.5+3)round 0)mod 7)}}}}}}|Missing required parameter 1=day!}}
{{WEEKDAYNUMBER|4}} returns {{#if:4|{{#switch:4|monday|mon=0|tuesday|tue=1|wednesday|wed=2|thursday|thu=3|friday|fri=4|saturday|sat=5|sunday|sun=6|{{#ifexpr:4<0|{{#ifexpr:((4)round 0)!=(4)|{{#expr:6-(((6.5-(4))round 0)mod 7)}}|{{#expr:6-(((5.5-(4))round 0)mod 7)}}}}|{{#expr:(((6.5+4)round 0)mod 7)}}}}}}|Missing required parameter 1=day!}}
{{WEEKDAYNUMBER|5}} returns {{#if:5|{{#switch:5|monday|mon=0|tuesday|tue=1|wednesday|wed=2|thursday|thu=3|friday|fri=4|saturday|sat=5|sunday|sun=6|{{#ifexpr:5<0|{{#ifexpr:((5)round 0)!=(5)|{{#expr:6-(((6.5-(5))round 0)mod 7)}}|{{#expr:6-(((5.5-(5))round 0)mod 7)}}}}|{{#expr:(((6.5+5)round 0)mod 7)}}}}}}|Missing required parameter 1=day!}}
{{WEEKDAYNUMBER|6}} returns {{#if:6|{{#switch:6|monday|mon=0|tuesday|tue=1|wednesday|wed=2|thursday|thu=3|friday|fri=4|saturday|sat=5|sunday|sun=6|{{#ifexpr:6<0|{{#ifexpr:((6)round 0)!=(6)|{{#expr:6-(((6.5-(6))round 0)mod 7)}}|{{#expr:6-(((5.5-(6))round 0)mod 7)}}}}|{{#expr:(((6.5+6)round 0)mod 7)}}}}}}|Missing required parameter 1=day!}}


Examples for week day numbers with extra leading zero:
{{WEEKDAYNUMBER|00}} returns {{#if:00|{{#switch:00|monday|mon=0|tuesday|tue=1|wednesday|wed=2|thursday|thu=3|friday|fri=4|saturday|sat=5|sunday|sun=6|{{#ifexpr:00<0|{{#ifexpr:((00)round 0)!=(00)|{{#expr:6-(((6.5-(00))round 0)mod 7)}}|{{#expr:6-(((5.5-(00))round 0)mod 7)}}}}|{{#expr:(((6.5+00)round 0)mod 7)}}}}}}|Missing required parameter 1=day!}}
{{WEEKDAYNUMBER|01}} returns {{#if:01|{{#switch:01|monday|mon=0|tuesday|tue=1|wednesday|wed=2|thursday|thu=3|friday|fri=4|saturday|sat=5|sunday|sun=6|{{#ifexpr:01<0|{{#ifexpr:((01)round 0)!=(01)|{{#expr:6-(((6.5-(01))round 0)mod 7)}}|{{#expr:6-(((5.5-(01))round 0)mod 7)}}}}|{{#expr:(((6.5+01)round 0)mod 7)}}}}}}|Missing required parameter 1=day!}}
{{WEEKDAYNUMBER|02}} returns {{#if:02|{{#switch:02|monday|mon=0|tuesday|tue=1|wednesday|wed=2|thursday|thu=3|friday|fri=4|saturday|sat=5|sunday|sun=6|{{#ifexpr:02<0|{{#ifexpr:((02)round 0)!=(02)|{{#expr:6-(((6.5-(02))round 0)mod 7)}}|{{#expr:6-(((5.5-(02))round 0)mod 7)}}}}|{{#expr:(((6.5+02)round 0)mod 7)}}}}}}|Missing required parameter 1=day!}}
{{WEEKDAYNUMBER|03}} returns {{#if:03|{{#switch:03|monday|mon=0|tuesday|tue=1|wednesday|wed=2|thursday|thu=3|friday|fri=4|saturday|sat=5|sunday|sun=6|{{#ifexpr:03<0|{{#ifexpr:((03)round 0)!=(03)|{{#expr:6-(((6.5-(03))round 0)mod 7)}}|{{#expr:6-(((5.5-(03))round 0)mod 7)}}}}|{{#expr:(((6.5+03)round 0)mod 7)}}}}}}|Missing required parameter 1=day!}}
{{WEEKDAYNUMBER|04}} returns {{#if:04|{{#switch:04|monday|mon=0|tuesday|tue=1|wednesday|wed=2|thursday|thu=3|friday|fri=4|saturday|sat=5|sunday|sun=6|{{#ifexpr:04<0|{{#ifexpr:((04)round 0)!=(04)|{{#expr:6-(((6.5-(04))round 0)mod 7)}}|{{#expr:6-(((5.5-(04))round 0)mod 7)}}}}|{{#expr:(((6.5+04)round 0)mod 7)}}}}}}|Missing required parameter 1=day!}}
{{WEEKDAYNUMBER|05}} returns {{#if:05|{{#switch:05|monday|mon=0|tuesday|tue=1|wednesday|wed=2|thursday|thu=3|friday|fri=4|saturday|sat=5|sunday|sun=6|{{#ifexpr:05<0|{{#ifexpr:((05)round 0)!=(05)|{{#expr:6-(((6.5-(05))round 0)mod 7)}}|{{#expr:6-(((5.5-(05))round 0)mod 7)}}}}|{{#expr:(((6.5+05)round 0)mod 7)}}}}}}|Missing required parameter 1=day!}}
{{WEEKDAYNUMBER|06}} returns {{#if:06|{{#switch:06|monday|mon=0|tuesday|tue=1|wednesday|wed=2|thursday|thu=3|friday|fri=4|saturday|sat=5|sunday|sun=6|{{#ifexpr:06<0|{{#ifexpr:((06)round 0)!=(06)|{{#expr:6-(((6.5-(06))round 0)mod 7)}}|{{#expr:6-(((5.5-(06))round 0)mod 7)}}}}|{{#expr:(((6.5+06)round 0)mod 7)}}}}}}|Missing required parameter 1=day!}}


Examples for week day number underflows and overflows, from computed values:
{{WEEKDAYNUMBER|-700}} returns {{#if:-700|{{#switch:-700|monday|mon=0|tuesday|tue=1|wednesday|wed=2|thursday|thu=3|friday|fri=4|saturday|sat=5|sunday|sun=6|{{#ifexpr:-700<0|{{#ifexpr:((-700)round 0)!=(-700)|{{#expr:6-(((6.5-(-700))round 0)mod 7)}}|{{#expr:6-(((5.5-(-700))round 0)mod 7)}}}}|{{#expr:(((6.5+-700)round 0)mod 7)}}}}}}|Missing required parameter 1=day!}}
{{WEEKDAYNUMBER|-701}} returns {{#if:-701|{{#switch:-701|monday|mon=0|tuesday|tue=1|wednesday|wed=2|thursday|thu=3|friday|fri=4|saturday|sat=5|sunday|sun=6|{{#ifexpr:-701<0|{{#ifexpr:((-701)round 0)!=(-701)|{{#expr:6-(((6.5-(-701))round 0)mod 7)}}|{{#expr:6-(((5.5-(-701))round 0)mod 7)}}}}|{{#expr:(((6.5+-701)round 0)mod 7)}}}}}}|Missing required parameter 1=day!}}
{{WEEKDAYNUMBER|-707}} returns {{#if:-707|{{#switch:-707|monday|mon=0|tuesday|tue=1|wednesday|wed=2|thursday|thu=3|friday|fri=4|saturday|sat=5|sunday|sun=6|{{#ifexpr:-707<0|{{#ifexpr:((-707)round 0)!=(-707)|{{#expr:6-(((6.5-(-707))round 0)mod 7)}}|{{#expr:6-(((5.5-(-707))round 0)mod 7)}}}}|{{#expr:(((6.5+-707)round 0)mod 7)}}}}}}|Missing required parameter 1=day!}}
{{WEEKDAYNUMBER|-7}} returns {{#if:-7|{{#switch:-7|monday|mon=0|tuesday|tue=1|wednesday|wed=2|thursday|thu=3|friday|fri=4|saturday|sat=5|sunday|sun=6|{{#ifexpr:-7<0|{{#ifexpr:((-7)round 0)!=(-7)|{{#expr:6-(((6.5-(-7))round 0)mod 7)}}|{{#expr:6-(((5.5-(-7))round 0)mod 7)}}}}|{{#expr:(((6.5+-7)round 0)mod 7)}}}}}}|Missing required parameter 1=day!}}
{{WEEKDAYNUMBER|-6}} returns {{#if:-6|{{#switch:-6|monday|mon=0|tuesday|tue=1|wednesday|wed=2|thursday|thu=3|friday|fri=4|saturday|sat=5|sunday|sun=6|{{#ifexpr:-6<0|{{#ifexpr:((-6)round 0)!=(-6)|{{#expr:6-(((6.5-(-6))round 0)mod 7)}}|{{#expr:6-(((5.5-(-6))round 0)mod 7)}}}}|{{#expr:(((6.5+-6)round 0)mod 7)}}}}}}|Missing required parameter 1=day!}}
{{WEEKDAYNUMBER|-5}} returns {{#if:-5|{{#switch:-5|monday|mon=0|tuesday|tue=1|wednesday|wed=2|thursday|thu=3|friday|fri=4|saturday|sat=5|sunday|sun=6|{{#ifexpr:-5<0|{{#ifexpr:((-5)round 0)!=(-5)|{{#expr:6-(((6.5-(-5))round 0)mod 7)}}|{{#expr:6-(((5.5-(-5))round 0)mod 7)}}}}|{{#expr:(((6.5+-5)round 0)mod 7)}}}}}}|Missing required parameter 1=day!}}
{{WEEKDAYNUMBER|-4}} returns {{#if:-4|{{#switch:-4|monday|mon=0|tuesday|tue=1|wednesday|wed=2|thursday|thu=3|friday|fri=4|saturday|sat=5|sunday|sun=6|{{#ifexpr:-4<0|{{#ifexpr:((-4)round 0)!=(-4)|{{#expr:6-(((6.5-(-4))round 0)mod 7)}}|{{#expr:6-(((5.5-(-4))round 0)mod 7)}}}}|{{#expr:(((6.5+-4)round 0)mod 7)}}}}}}|Missing required parameter 1=day!}}
{{WEEKDAYNUMBER|-3}} returns {{#if:-3|{{#switch:-3|monday|mon=0|tuesday|tue=1|wednesday|wed=2|thursday|thu=3|friday|fri=4|saturday|sat=5|sunday|sun=6|{{#ifexpr:-3<0|{{#ifexpr:((-3)round 0)!=(-3)|{{#expr:6-(((6.5-(-3))round 0)mod 7)}}|{{#expr:6-(((5.5-(-3))round 0)mod 7)}}}}|{{#expr:(((6.5+-3)round 0)mod 7)}}}}}}|Missing required parameter 1=day!}}
{{WEEKDAYNUMBER|-2}} returns {{#if:-2|{{#switch:-2|monday|mon=0|tuesday|tue=1|wednesday|wed=2|thursday|thu=3|friday|fri=4|saturday|sat=5|sunday|sun=6|{{#ifexpr:-2<0|{{#ifexpr:((-2)round 0)!=(-2)|{{#expr:6-(((6.5-(-2))round 0)mod 7)}}|{{#expr:6-(((5.5-(-2))round 0)mod 7)}}}}|{{#expr:(((6.5+-2)round 0)mod 7)}}}}}}|Missing required parameter 1=day!}}
{{WEEKDAYNUMBER|-1}} returns {{#if:-1|{{#switch:-1|monday|mon=0|tuesday|tue=1|wednesday|wed=2|thursday|thu=3|friday|fri=4|saturday|sat=5|sunday|sun=6|{{#ifexpr:-1<0|{{#ifexpr:((-1)round 0)!=(-1)|{{#expr:6-(((6.5-(-1))round 0)mod 7)}}|{{#expr:6-(((5.5-(-1))round 0)mod 7)}}}}|{{#expr:(((6.5+-1)round 0)mod 7)}}}}}}|Missing required parameter 1=day!}}
{{WEEKDAYNUMBER|-0.9999}} returns {{#if:-0.9999|{{#switch:-0.9999|monday|mon=0|tuesday|tue=1|wednesday|wed=2|thursday|thu=3|friday|fri=4|saturday|sat=5|sunday|sun=6|{{#ifexpr:-0.9999<0|{{#ifexpr:((-0.9999)round 0)!=(-0.9999)|{{#expr:6-(((6.5-(-0.9999))round 0)mod 7)}}|{{#expr:6-(((5.5-(-0.9999))round 0)mod 7)}}}}|{{#expr:(((6.5+-0.9999)round 0)mod 7)}}}}}}|Missing required parameter 1=day!}}
{{WEEKDAYNUMBER|-0.5}} returns {{#if:-0.5|{{#switch:-0.5|monday|mon=0|tuesday|tue=1|wednesday|wed=2|thursday|thu=3|friday|fri=4|saturday|sat=5|sunday|sun=6|{{#ifexpr:-0.5<0|{{#ifexpr:((-0.5)round 0)!=(-0.5)|{{#expr:6-(((6.5-(-0.5))round 0)mod 7)}}|{{#expr:6-(((5.5-(-0.5))round 0)mod 7)}}}}|{{#expr:(((6.5+-0.5)round 0)mod 7)}}}}}}|Missing required parameter 1=day!}}
{{WEEKDAYNUMBER|-0.0001}} returns {{#if:-0.0001|{{#switch:-0.0001|monday|mon=0|tuesday|tue=1|wednesday|wed=2|thursday|thu=3|friday|fri=4|saturday|sat=5|sunday|sun=6|{{#ifexpr:-0.0001<0|{{#ifexpr:((-0.0001)round 0)!=(-0.0001)|{{#expr:6-(((6.5-(-0.0001))round 0)mod 7)}}|{{#expr:6-(((5.5-(-0.0001))round 0)mod 7)}}}}|{{#expr:(((6.5+-0.0001)round 0)mod 7)}}}}}}|Missing required parameter 1=day!}}
{{WEEKDAYNUMBER|0}} returns {{#if:0|{{#switch:0|monday|mon=0|tuesday|tue=1|wednesday|wed=2|thursday|thu=3|friday|fri=4|saturday|sat=5|sunday|sun=6|{{#ifexpr:0<0|{{#ifexpr:((0)round 0)!=(0)|{{#expr:6-(((6.5-(0))round 0)mod 7)}}|{{#expr:6-(((5.5-(0))round 0)mod 7)}}}}|{{#expr:(((6.5+0)round 0)mod 7)}}}}}}|Missing required parameter 1=day!}}
{{WEEKDAYNUMBER|0.0001}} returns {{#if:0.0001|{{#switch:0.0001|monday|mon=0|tuesday|tue=1|wednesday|wed=2|thursday|thu=3|friday|fri=4|saturday|sat=5|sunday|sun=6|{{#ifexpr:0.0001<0|{{#ifexpr:((0.0001)round 0)!=(0.0001)|{{#expr:6-(((6.5-(0.0001))round 0)mod 7)}}|{{#expr:6-(((5.5-(0.0001))round 0)mod 7)}}}}|{{#expr:(((6.5+0.0001)round 0)mod 7)}}}}}}|Missing required parameter 1=day!}}
{{WEEKDAYNUMBER|0.5}} returns {{#if:0|{{#switch:0|monday|mon=0|tuesday|tue=1|wednesday|wed=2|thursday|thu=3|friday|fri=4|saturday|sat=5|sunday|sun=6|{{#ifexpr:0<0|{{#ifexpr:((0)round 0)!=(0)|{{#expr:6-(((6.5-(0))round 0)mod 7)}}|{{#expr:6-(((5.5-(0))round 0)mod 7)}}}}|{{#expr:(((6.5+0)round 0)mod 7)}}}}}}|Missing required parameter 1=day!}}
{{WEEKDAYNUMBER|0.9999}} returns {{#if:0.9999|{{#switch:0.9999|monday|mon=0|tuesday|tue=1|wednesday|wed=2|thursday|thu=3|friday|fri=4|saturday|sat=5|sunday|sun=6|{{#ifexpr:0.9999<0|{{#ifexpr:((0.9999)round 0)!=(0.9999)|{{#expr:6-(((6.5-(0.9999))round 0)mod 7)}}|{{#expr:6-(((5.5-(0.9999))round 0)mod 7)}}}}|{{#expr:(((6.5+0.9999)round 0)mod 7)}}}}}}|Missing required parameter 1=day!}}
{{WEEKDAYNUMBER|6.0001}} returns {{#if:6.0001|{{#switch:6.0001|monday|mon=0|tuesday|tue=1|wednesday|wed=2|thursday|thu=3|friday|fri=4|saturday|sat=5|sunday|sun=6|{{#ifexpr:6.0001<0|{{#ifexpr:((6.0001)round 0)!=(6.0001)|{{#expr:6-(((6.5-(6.0001))round 0)mod 7)}}|{{#expr:6-(((5.5-(6.0001))round 0)mod 7)}}}}|{{#expr:(((6.5+6.0001)round 0)mod 7)}}}}}}|Missing required parameter 1=day!}}
{{WEEKDAYNUMBER|6.5}} returns {{#if:6.5|{{#switch:6.5|monday|mon=0|tuesday|tue=1|wednesday|wed=2|thursday|thu=3|friday|fri=4|saturday|sat=5|sunday|sun=6|{{#ifexpr:6.5<0|{{#ifexpr:((6.5)round 0)!=(6.5)|{{#expr:6-(((6.5-(6.5))round 0)mod 7)}}|{{#expr:6-(((5.5-(6.5))round 0)mod 7)}}}}|{{#expr:(((6.5+6.5)round 0)mod 7)}}}}}}|Missing required parameter 1=day!}}
{{WEEKDAYNUMBER|6.9999}} returns {{#if:6.9999|{{#switch:6.9999|monday|mon=0|tuesday|tue=1|wednesday|wed=2|thursday|thu=3|friday|fri=4|saturday|sat=5|sunday|sun=6|{{#ifexpr:6.9999<0|{{#ifexpr:((6.9999)round 0)!=(6.9999)|{{#expr:6-(((6.5-(6.9999))round 0)mod 7)}}|{{#expr:6-(((5.5-(6.9999))round 0)mod 7)}}}}|{{#expr:(((6.5+6.9999)round 0)mod 7)}}}}}}|Missing required parameter 1=day!}}
{{WEEKDAYNUMBER|7}} returns {{#if:7|{{#switch:7|monday|mon=0|tuesday|tue=1|wednesday|wed=2|thursday|thu=3|friday|fri=4|saturday|sat=5|sunday|sun=6|{{#ifexpr:7<0|{{#ifexpr:((7)round 0)!=(7)|{{#expr:6-(((6.5-(7))round 0)mod 7)}}|{{#expr:6-(((5.5-(7))round 0)mod 7)}}}}|{{#expr:(((6.5+7)round 0)mod 7)}}}}}}|Missing required parameter 1=day!}}
{{WEEKDAYNUMBER|8}} returns {{#if:8|{{#switch:8|monday|mon=0|tuesday|tue=1|wednesday|wed=2|thursday|thu=3|friday|fri=4|saturday|sat=5|sunday|sun=6|{{#ifexpr:8<0|{{#ifexpr:((8)round 0)!=(8)|{{#expr:6-(((6.5-(8))round 0)mod 7)}}|{{#expr:6-(((5.5-(8))round 0)mod 7)}}}}|{{#expr:(((6.5+8)round 0)mod 7)}}}}}}|Missing required parameter 1=day!}}
{{WEEKDAYNUMBER|14}} returns {{#if:14|{{#switch:14|monday|mon=0|tuesday|tue=1|wednesday|wed=2|thursday|thu=3|friday|fri=4|saturday|sat=5|sunday|sun=6|{{#ifexpr:14<0|{{#ifexpr:((14)round 0)!=(14)|{{#expr:6-(((6.5-(14))round 0)mod 7)}}|{{#expr:6-(((5.5-(14))round 0)mod 7)}}}}|{{#expr:(((6.5+14)round 0)mod 7)}}}}}}|Missing required parameter 1=day!}}
{{WEEKDAYNUMBER|700}} returns {{#if:700|{{#switch:700|monday|mon=0|tuesday|tue=1|wednesday|wed=2|thursday|thu=3|friday|fri=4|saturday|sat=5|sunday|sun=6|{{#ifexpr:700<0|{{#ifexpr:((700)round 0)!=(700)|{{#expr:6-(((6.5-(700))round 0)mod 7)}}|{{#expr:6-(((5.5-(700))round 0)mod 7)}}}}|{{#expr:(((6.5+700)round 0)mod 7)}}}}}}|Missing required parameter 1=day!}}
{{WEEKDAYNUMBER|701}} returns {{#if:701|{{#switch:701|monday|mon=0|tuesday|tue=1|wednesday|wed=2|thursday|thu=3|friday|fri=4|saturday|sat=5|sunday|sun=6|{{#ifexpr:701<0|{{#ifexpr:((701)round 0)!=(701)|{{#expr:6-(((6.5-(701))round 0)mod 7)}}|{{#expr:6-(((5.5-(701))round 0)mod 7)}}}}|{{#expr:(((6.5+701)round 0)mod 7)}}}}}}|Missing required parameter 1=day!}}
{{WEEKDAYNUMBER|707}} returns {{#if:707|{{#switch:707|monday|mon=0|tuesday|tue=1|wednesday|wed=2|thursday|thu=3|friday|fri=4|saturday|sat=5|sunday|sun=6|{{#ifexpr:707<0|{{#ifexpr:((707)round 0)!=(707)|{{#expr:6-(((6.5-(707))round 0)mod 7)}}|{{#expr:6-(((5.5-(707))round 0)mod 7)}}}}|{{#expr:(((6.5+707)round 0)mod 7)}}}}}}|Missing required parameter 1=day!}}


Example for invalid week day name:
{{WEEKDAYNUMBER|xxx}} returns {{#if:xxx|{{#switch:xxx|monday|mon=0|tuesday|tue=1|wednesday|wed=2|thursday|thu=3|friday|fri=4|saturday|sat=5|sunday|sun=6|{{#ifexpr:xxx<0|{{#ifexpr:((xxx)round 0)!=(xxx)|{{#expr:6-(((6.5-(xxx))round 0)mod 7)}}|{{#expr:6-(((5.5-(xxx))round 0)mod 7)}}}}|{{#expr:(((6.5+xxx)round 0)mod 7)}}}}}}|Missing required parameter 1=day!}}


See also:
Template:WEEKDAYNAME
Template:WEEKDAYABBREV
Template:WEEKDAY
Template:CURRENTWEEKDAY