Difference between revisions of "Template:Currentweek"

From QBWiki
Jump to navigation Jump to search
m
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{#vardefine:dayofweek|{{#time:l|+{{#expr:{{{1|0}}}*7}}}}}}{{#ifeq:{{#var:dayofweek}}|Saturday
+
{{#vardefine:offset|{{dayoffset}}}}{{#time:F j, Y|{{#expr: {{{1|0}}}*7-{{#var:offset}}}} days}}-{{#time:F j, Y|{{#expr: {{{1|0}}}*7-{{#var:offset}}+6}} days}}<noinclude>
|{{#vardefine:offset|0}}
 
|{{#ifeq:{{#var:dayofweek}}|Sunday
 
<!---->|{{#vardefine:offset|1}}
 
<!---->|{{#ifeq:{{#var:dayofweek}}|Monday
 
<!----><!---->|{{#vardefine:offset|2}}
 
<!----><!---->|{{#ifeq:{{#var:dayofweek}}|Tuesday
 
<!----><!----><!---->|{{#vardefine:offset|3}}
 
<!----><!----><!---->|{{#ifeq:{{#var:dayofweek}}|Wednesday
 
<!----><!----><!----><!---->|{{#vardefine:offset|4}}
 
<!----><!----><!----><!---->|{{#ifeq:{{#var:dayofweek}}|Thursday
 
<!----><!----><!----><!----><!---->|{{#vardefine:offset|5}}
 
<!----><!----><!----><!----><!---->|{{#ifeq:{{#var:dayofweek}}|Friday
 
<!----><!----><!----><!----><!----><!---->|{{#vardefine:offset|6}}
 
<!----><!----><!----><!----><!----><!---->|shouldn't be hit
 
<!----><!----><!----><!----><!---->}}
 
<!----><!----><!----><!---->}}
 
<!----><!----><!---->}}
 
<!----><!---->}}
 
<!---->}}
 
}}}}{{#time:F j, Y|-{{#var:offset}} day}}-{{#time:F j, Y|+{{#expr:7-{{#var:offset}}}} day}}<noinclude>
 
  
The week from Saturday to Friday. Intended to represent the period of time in which a set of [[tournament]] results from a given weekend is the most recent. There currently {{#ifexist:QBWiki:Recent tournament results/{{currentweek}}|is|is not}} a page of results for the [[QBWiki:Recent tournament results/{{currentweek}}|current week]].
+
The week from Saturday to Friday. Intended to represent the period of time in which a set of [[tournament]] results from a given weekend is the most recent. There currently ''{{#ifexist:QBWiki:Recent tournament results/{{currentweek}}|is|is not}}'' a page of results for the [[QBWiki:Recent tournament results/{{currentweek}}|current week]].
 +
 
 +
Can be offset by providing a week offset
 +
{| class="wikitable"
 +
! input
 +
! output
 +
|-
 +
|<nowiki>{{currentweek|-2}}</nowiki>||{{currentweek|-2}}
 +
|-
 +
|<nowiki>{{currentweek|-1}}</nowiki>||{{currentweek|-1}}
 +
|-
 +
|<nowiki>{{currentweek|0}}</nowiki>||{{currentweek|0}}
 +
|-
 +
|<nowiki>{{currentweek|1}}</nowiki>||{{currentweek|1}}
 +
|-
 +
|<nowiki>{{currentweek|2}}</nowiki>||{{currentweek|2}}
 +
|}
 
</noinclude>
 
</noinclude>

Latest revision as of 18:57, 7 November 2021

May 18, 2024-May 24, 2024

The week from Saturday to Friday. Intended to represent the period of time in which a set of tournament results from a given weekend is the most recent. There currently is not a page of results for the current week.

Can be offset by providing a week offset

input output
{{currentweek|-2}} May 4, 2024-May 10, 2024
{{currentweek|-1}} May 11, 2024-May 17, 2024
{{currentweek|0}} May 18, 2024-May 24, 2024
{{currentweek|1}} May 25, 2024-May 31, 2024
{{currentweek|2}} June 1, 2024-June 7, 2024