Difference between revisions of "Template:Dow date to use"

From Geohashing
imported>Tjtrumpet2323
imported>Tjtrumpet2323
Line 2: Line 2:
 
| {{#vardefine:base|{{#time:Y-m-d|{{{1|{{CURRENTTIMESTAMP}}}}} -1 day }} }}
 
| {{#vardefine:base|{{#time:Y-m-d|{{{1|{{CURRENTTIMESTAMP}}}}} -1 day }} }}
 
| {{#vardefine:base|{{#time:Y-m-d|{{{1|{{CURRENTTIMESTAMP}}}}} }} }}
 
| {{#vardefine:base|{{#time:Y-m-d|{{{1|{{CURRENTTIMESTAMP}}}}} }} }}
}}{{#ifexpr: ({{#time:N|{{#var:base}} }} >= 6) | {{#vardefine:base|{{#time:Y-m-d|{{{1|{{CURRENTTIMESTAMP}}}}} last Friday }} }} }}{{#ifeq: {{Dow holiday|{{#var:base}}}} | 1 | {{#var:base}} | {{Previous weekday|{{#var:base}}}} }}<noinclude>
+
}}{{#ifexpr: ({{#time:N|{{#var:base}} }} >= 6) | {{#vardefine:base|{{#time:Y-m-d|{{#var:base}} last Friday }} }} }}{{#ifeq: {{Dow holiday|{{#var:base}}}} | 1 | {{#var:base}} | {{Previous weekday|{{#var:base}}}} }}<noinclude>
 
== Usage ==
 
== Usage ==
 
{{intricate}}
 
{{intricate}}

Revision as of 21:24, 8 July 2008

2024-11-21

Usage

{{Dow date to use|2008-05-25|30w=0}}

  • Defaults to using current date. Use parameter in yyyy-mm-dd format for other dates.
  • Considers weekends and backwards-compatible 30W rule.
    • Defaults to not using 30W rule (i.e., gives coords for west of 30W). For east of 30W, use 30w=1 parameter.
    • Does not apply 30W rule prior to 2008-05-27, even if parameter is passed.
  • Considers Dow holidays (progammatically determined by Template:Dow holiday).