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

From Geohashing
imported>Tjtrumpet2323
m (Usage)
imported>Tjtrumpet2323
 
(8 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{ #ifexpr: {{ #time: N | {{{1|{{CURRENTTIMESTAMP}} }}} }} >= 6
+
{{#vardefine:base|{{#time:Y-m-d|{{{1|{{CURRENTTIMESTAMP}}}}} }} }}{{#ifexpr: ({{{30w|0}}} = 1 and {{#time:Ymd|{{{1|{{CURRENTTIMESTAMP}}}}} }} >= 20080527) | {{#vardefine:base|{{#time:Y-m-d|{{#var:base}} -1 day }} }} }}{{#ifexpr: ({{#time:N|{{#var:base}} }} >= 6) | {{#vardefine:base|{{#time:Y-m-d|{{#var:base}} last Friday }} }} }}{{#ifeq: {{Dow holiday|{{#var:base}}}} | 1 | {{Previous weekday|{{#var:base}}}} | {{#var:base}} }}<noinclude>
| {{Dow date to use/isWeekend|{{{1|{{CURRENTTIMESTAMP}} }}}|30w={{{30w|0}}} }} <!-- is a Saturday/Sunday, use Friday, but check holidays first -->
 
| {{Dow date to use/isWeekday|{{{1|{{CURRENTTIMESTAMP}} }}}|30w={{{30w|0}}} }} <!-- is a weekday, use self, but check holidays first -->
 
}}<noinclude>
 
 
== Usage ==
 
== Usage ==
 +
{{intricate}}
 
<code><nowiki>{{Dow date to use|2008-05-25|30w=0}}</nowiki></code>
 
<code><nowiki>{{Dow date to use|2008-05-25|30w=0}}</nowiki></code>
  
Line 10: Line 8:
 
** Defaults to '''not''' using 30W rule (i.e., gives coords for west of 30W).  For east of 30W, use <code><nowiki>30w=1</nowiki></code> parameter.
 
** Defaults to '''not''' using 30W rule (i.e., gives coords for west of 30W).  For east of 30W, use <code><nowiki>30w=1</nowiki></code> parameter.
 
** Does not apply 30W rule prior to 2008-05-27, even if parameter is passed.
 
** Does not apply 30W rule prior to 2008-05-27, even if parameter is passed.
* Considers [[Dow holiday]]s found at [[Template:Dow date to use/considerHolidays]].
+
* Considers [[Dow holiday]]s (progammatically determined by [[Template:Dow holiday]]).
 
</noinclude>
 
</noinclude>

Latest revision as of 21:45, 8 July 2008

2024-11-25

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).