Difference between revisions of "Template:Dow holiday"

From Geohashing
imported>Mattyk
m (renamed variable 'date' to 'qdate', for namespace issues.)
(Add Juneteenth beginning in June 2022, now that it's officially published as an NYSE holiday.)
 
Line 5: Line 5:
 
  | 4 = {{#ifexpr: ({{#time:Ymd|{{#var:qdate}}}} = {{#time:Ymd|{{Easter|{{#time:Y|{{#var:qdate}}}}}} -2 days}}) | 1 | 0}}
 
  | 4 = {{#ifexpr: ({{#time:Ymd|{{#var:qdate}}}} = {{#time:Ymd|{{Easter|{{#time:Y|{{#var:qdate}}}}}} -2 days}}) | 1 | 0}}
 
  | 5 = {{#ifexpr: ({{#time:j|{{#var:qdate}}}} = {{weekday in month|{{#time:Y|{{#var:qdate}}}}|5|1|-1}}) | 1 | 0}}
 
  | 5 = {{#ifexpr: ({{#time:j|{{#var:qdate}}}} = {{weekday in month|{{#time:Y|{{#var:qdate}}}}|5|1|-1}}) | 1 | 0}}
  | 6 = 0
+
  | 6 = {{#ifexpr: ({{#time:Y|{{#var:qdate}}}} >= 2022) | {{#ifexpr: ({{#time:j|{{#var:qdate}}}} = 18 and {{#time:N|{{#var:qdate}}}} = 5) or ({{#time:j|{{#var:qdate}}}} = 19 and {{#var:weekday}} = 1) or ({{#time:j|{{#var:qdate}}}} = 20 and {{#time:N|{{#var:qdate}}}} = 1) | 1 | 0}} | 0}}
 
  | 7 = {{#ifexpr: ({{#time:j|{{#var:qdate}}}} = 3 and {{#time:N|{{#var:qdate}}}} = 5) or ({{#time:j|{{#var:qdate}}}} = 4 and {{#var:weekday}} = 1) or ({{#time:j|{{#var:qdate}}}} = 5 and {{#time:N|{{#var:qdate}}}} = 1) | 1 | 0}}
 
  | 7 = {{#ifexpr: ({{#time:j|{{#var:qdate}}}} = 3 and {{#time:N|{{#var:qdate}}}} = 5) or ({{#time:j|{{#var:qdate}}}} = 4 and {{#var:weekday}} = 1) or ({{#time:j|{{#var:qdate}}}} = 5 and {{#time:N|{{#var:qdate}}}} = 1) | 1 | 0}}
 
  | 8 = 0
 
  | 8 = 0
Line 20: Line 20:
 
** Weekends return 0 and are not treated as holidays, as they can be programmatically handled by other templates.
 
** 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.
 
** All holidays are systematically and calculationally determined.
 +
 +
=== Notes ===
 +
* '''This template is only explicitly valid from 2008 through the reasonably expected future.'''
 +
** This template incorporates [https://en.wikipedia.org/wiki/Juneteenth Juneteenth National Independence Day] with effect from June 2022.
 +
* While NYSE holidays were generally stable for some time before the creation of Geohashing in 2008, this template applies all holidays observed at that time proleptically into the indefinite past.  It does not contemplate, for example, when precisely among its various stages of recognition and adoption the NYSE began observing [https://en.wikipedia.org/wiki/Martin_Luther_King_Jr._Day Martin Luther King, Jr. Day].
  
 
== See also ==
 
== See also ==
[http://www.nyse.com/about/newsevents/1176373643795.html?sa_campaign=/internal_ads/callouts/holidays NYSE Calendar]
+
[https://www.nyse.com/markets/hours-calendars NYSE Calendar]
 
</noinclude>
 
</noinclude>

Latest revision as of 15:43, 17 October 2021

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.

Notes

  • This template is only explicitly valid from 2008 through the reasonably expected future.
  • While NYSE holidays were generally stable for some time before the creation of Geohashing in 2008, this template applies all holidays observed at that time proleptically into the indefinite past. It does not contemplate, for example, when precisely among its various stages of recognition and adoption the NYSE began observing Martin Luther King, Jr. Day.

See also

NYSE Calendar