Difference between revisions of "Template:Dow holiday"

From Geohashing
imported>Tjtrumpet2323
m
imported>Tjtrumpet2323
(GAAH!!!! I left a test {{#vardefine:date|2010-04-02}} in this template?!??!?! WHY?!!)
Line 1: Line 1:
<includeonly>{{#vardefine:date|2010-04-02}}{{#ifexpr: {{#time:N|{{#var:date}}}} <= 5 | {{#vardefine:weekday|1}} | {{#vardefine:weekday|0}} }}{{#switch: {{#time:m|{{#var:date}}}}
+
<includeonly>{{#vardefine:date|{{{1|{{CURRENTTIMESTAMP}}}}}}}{{#ifexpr: {{#time:N|{{#var:date}}}} <= 5 | {{#vardefine:weekday|1}} | {{#vardefine:weekday|0}} }}{{#switch: {{#time:m|{{#var:date}}}}
 
  | 1 = {{#ifexpr: ({{#time:j|{{#var:date}}}} = 1 and {{#var:weekday}} = 1) or ({{#time:j|{{#var:date}}}} = 2 and {{#time:N|{{#var:date}}}} = 1) or ({{#time:j|{{#var:date}}}} = {{weekday in month|{{#time:Y|{{#var:date}}}}|1|1|3}}) | 1 | 0}}
 
  | 1 = {{#ifexpr: ({{#time:j|{{#var:date}}}} = 1 and {{#var:weekday}} = 1) or ({{#time:j|{{#var:date}}}} = 2 and {{#time:N|{{#var:date}}}} = 1) or ({{#time:j|{{#var:date}}}} = {{weekday in month|{{#time:Y|{{#var:date}}}}|1|1|3}}) | 1 | 0}}
 
  | 2 = {{#ifexpr: ({{#time:j|{{#var:date}}}} = {{weekday in month|{{#time:Y|{{#var:date}}}}|2|1|3}}) | 1 | 0}}
 
  | 2 = {{#ifexpr: ({{#time:j|{{#var:date}}}} = {{weekday in month|{{#time:Y|{{#var:date}}}}|2|1|3}}) | 1 | 0}}

Revision as of 20:53, 8 July 2008

Usage

{{Dow holiday|2008-11-27}}

  • Date must be passed in YYYY-MM-DD format.
  • Returns 1 if the date passed is a Dow holiday; 0 otherwise.
    • Weekends return 0 and are not treated as holidays, as they can be programmatically handled by other templates.
    • All holidays are systematically and calculationally determined.

See also

NYSE Calendar