Difference between revisions of "Template:Currentweek"

From QBWiki
Jump to navigation Jump to search
(Created page with "{{#vardefine:dayofweek|{{#time:l|+{{#expr:{{{1|0}}}*7}}}}}} {{#ifeq:{{#var:dayofweek}}|Saturday |{{#vardefine:offset|0}} |{{#ifeq:{{#var:dayofweek}}|Sunday <!---->|{{#vardefin...")
 
m
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{#vardefine:dayofweek|{{#time:l|+{{#expr:{{{1|0}}}*7}}}}}}
+
{{#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>
{{#ifeq:{{#var:dayofweek}}|Saturday
+
 
|{{#vardefine:offset|0}}
+
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]].
|{{#ifeq:{{#var:dayofweek}}|Sunday
+
 
<!---->|{{#vardefine:offset|1}}
+
Can be offset by providing a week offset
<!---->|{{#ifeq:{{#var:dayofweek}}|Monday
+
{| class="wikitable"
<!----><!---->|{{#vardefine:offset|2}}
+
! input
<!----><!---->|{{#ifeq:{{#var:dayofweek}}|Tuesday
+
! output
<!----><!----><!---->|{{#vardefine:offset|3}}
+
|-
<!----><!----><!---->|{{#ifeq:{{#var:dayofweek}}|Wednesday
+
|<nowiki>{{currentweek|-2}}</nowiki>||{{currentweek|-2}}
<!----><!----><!----><!---->|{{#vardefine:offset|4}}
+
|-
<!----><!----><!----><!---->|{{#ifeq:{{#var:dayofweek}}|Thursday
+
|<nowiki>{{currentweek|-1}}</nowiki>||{{currentweek|-1}}
<!----><!----><!----><!----><!---->|{{#vardefine:offset|5}}
+
|-
<!----><!----><!----><!----><!---->|{{#ifeq:{{#var:dayofweek}}|Friday
+
|<nowiki>{{currentweek|0}}</nowiki>||{{currentweek|0}}
<!----><!----><!----><!----><!----><!---->|{{#vardefine:offset|6}}
+
|-
<!----><!----><!----><!----><!----><!---->|shouldn't be hit
+
|<nowiki>{{currentweek|1}}</nowiki>||{{currentweek|1}}
<!----><!----><!----><!----><!---->}}
+
|-
<!----><!----><!----><!---->}}
+
|<nowiki>{{currentweek|2}}</nowiki>||{{currentweek|2}}
<!----><!----><!---->}}
+
|}
<!----><!---->}}
+
</noinclude>
<!---->}}
 
}}}}{{#time:F j, Y|-{{#var:offset}} day}}-{{#time:F j, Y|+{{#expr:7-{{#var:offset}}}} day}}
 

Latest revision as of 17:57, 7 November 2021

November 16, 2024-November 22, 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}} November 2, 2024-November 8, 2024
{{currentweek|-1}} November 9, 2024-November 15, 2024
{{currentweek|0}} November 16, 2024-November 22, 2024
{{currentweek|1}} November 23, 2024-November 29, 2024
{{currentweek|2}} November 30, 2024-December 6, 2024