forked from holidays/definitions
-
Notifications
You must be signed in to change notification settings - Fork 0
/
nyse.yaml
116 lines (114 loc) · 2.31 KB
/
nyse.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
# NYSE holiday definitions for the Ruby Holiday gem.
#
# By Alan Larkin
# Source: http://www.nyse.com/about/newsevents/1176373643795.html#earlyclose2008
#
# Updated 2008-11-19.
#
# Source: https://www.nyse.com/markets/hours-calendars
# Updated 2017-03-14 By Vassilios Liatsos
---
months:
0:
- name: Good Friday
regions: [nyse]
function: easter(year)
function_modifier: -2
1:
- name: New Year's Day
regions: [nyse]
mday: 1
observed: to_monday_if_sunday(date)
- name: Martin Luther King, Jr. Day
week: 3
regions: [nyse]
wday: 1
2:
- name: Presidents' Day
week: 3
regions: [nyse]
wday: 1
5:
- name: Memorial Day
week: -1
regions: [nyse]
wday: 1
7:
- name: Independence Day
regions: [nyse]
mday: 4
observed: to_weekday_if_weekend(date)
9:
- name: Labor Day
week: 1
regions: [nyse]
wday: 1
11:
- name: Thanksgiving
week: 4
regions: [nyse]
wday: 4
12:
- name: Christmas Day
regions: [nyse]
mday: 25
observed: to_weekday_if_weekend(date)
tests:
- given:
date: '2008-01-01'
regions: ["nyse"]
expect:
name: "New Year's Day"
- given:
date: ['2017-01-02', '2012-01-02', '2011-01-01', '2006-01-02']
regions: ["nyse"]
options: ["observed"]
expect:
name: "New Year's Day"
- given:
date: '2008-01-21'
regions: ["nyse"]
expect:
name: "Martin Luther King, Jr. Day"
- given:
date: '2008-02-18'
regions: ["nyse"]
expect:
name: "Presidents' Day"
- given:
date: '2008-03-21'
regions: ["nyse"]
expect:
name: "Good Friday"
- given:
date: '2008-05-26'
regions: ["nyse"]
expect:
name: "Memorial Day"
- given:
date: '2008-07-04'
regions: ["nyse"]
expect:
name: "Independence Day"
- given:
date: '2008-09-01'
regions: ["nyse"]
expect:
name: "Labor Day"
- given:
date: '2008-11-27'
regions: ["nyse"]
expect:
name: "Thanksgiving"
- given:
date: '2008-12-25'
regions: ["nyse"]
expect:
name: "Christmas Day"
# Test observed New Year
- given:
date: ['2017-01-02', '2012-01-02', '2011-01-01', '2006-01-02']
regions: ["nyse"]
options: ["observed"]
expect:
name: "New Year's Day"