Jump to content

Stampa:WEEKDAYNUMBER

Nga Wikipedia, enciklopedia e lirë

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 5.
Note:
The returned value is ordered from 0 to 6 according to the ISO week (Monday to Sunday), and is consistant 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 0
{{WEEKDAYNUMBER|tuesday}} returns 1
{{WEEKDAYNUMBER|wednesday}} returns 2
{{WEEKDAYNUMBER|thursday}} returns 3
{{WEEKDAYNUMBER|friday}} returns 4
{{WEEKDAYNUMBER|saturday}} returns 5
{{WEEKDAYNUMBER|sunday}} returns 6
Examples for all abbreviated English week day names:
{{WEEKDAYNUMBER|mon}} returns 0
{{WEEKDAYNUMBER|tue}} returns 1
{{WEEKDAYNUMBER|wed}} returns 2
{{WEEKDAYNUMBER|thu}} returns 3
{{WEEKDAYNUMBER|fri}} returns 4
{{WEEKDAYNUMBER|sat}} returns 5
{{WEEKDAYNUMBER|sun}} returns 6
Examples for all standard week day numbers:
{{WEEKDAYNUMBER|0}} returns 0
{{WEEKDAYNUMBER|1}} returns 1
{{WEEKDAYNUMBER|2}} returns 2
{{WEEKDAYNUMBER|3}} returns 3
{{WEEKDAYNUMBER|4}} returns 4
{{WEEKDAYNUMBER|5}} returns 5
{{WEEKDAYNUMBER|6}} returns 6
Examples for week day numbers with extra leading zero:
{{WEEKDAYNUMBER|00}} returns 0
{{WEEKDAYNUMBER|01}} returns 1
{{WEEKDAYNUMBER|02}} returns 2
{{WEEKDAYNUMBER|03}} returns 3
{{WEEKDAYNUMBER|04}} returns 4
{{WEEKDAYNUMBER|05}} returns 5
{{WEEKDAYNUMBER|06}} returns 6
Examples for week day number underflows and overflows, from computed values:
{{WEEKDAYNUMBER|-700}} returns 0
{{WEEKDAYNUMBER|-701}} returns 6
{{WEEKDAYNUMBER|-707}} returns 0
{{WEEKDAYNUMBER|-7}} returns 0
{{WEEKDAYNUMBER|-6}} returns 1
{{WEEKDAYNUMBER|-5}} returns 2
{{WEEKDAYNUMBER|-4}} returns 3
{{WEEKDAYNUMBER|-3}} returns 4
{{WEEKDAYNUMBER|-2}} returns 5
{{WEEKDAYNUMBER|-1}} returns 6
{{WEEKDAYNUMBER|-0.9999}} returns 6
{{WEEKDAYNUMBER|-0.5}} returns 6
{{WEEKDAYNUMBER|-0.0001}} returns 6
{{WEEKDAYNUMBER|0}} returns 0
{{WEEKDAYNUMBER|0.0001}} returns 0
{{WEEKDAYNUMBER|0.5}} returns 0
{{WEEKDAYNUMBER|0.9999}} returns 0
{{WEEKDAYNUMBER|6.0001}} returns 6
{{WEEKDAYNUMBER|6.5}} returns 6
{{WEEKDAYNUMBER|6.9999}} returns 6
{{WEEKDAYNUMBER|7}} returns 0
{{WEEKDAYNUMBER|8}} returns 1
{{WEEKDAYNUMBER|14}} returns 0
{{WEEKDAYNUMBER|700}} returns 0
{{WEEKDAYNUMBER|701}} returns 1
{{WEEKDAYNUMBER|707}} returns 0
Example for invalid week day name:
{{WEEKDAYNUMBER|xxx}} returns Gabim shprehjeje: Fjalë e panjohur: xxx
See also:
Template:WEEKDAYNAME
Template:WEEKDAYABBREV
Template:WEEKDAY
Template:CURRENTWEEKDAY