-
Notifications
You must be signed in to change notification settings - Fork 136
/
ups.yaml
102 lines (100 loc) · 1.99 KB
/
ups.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
# UPS holiday definitions for the Ruby Holiday gem.
#
# By Tim Anglade
#
# Updated: 2008-09-23.
# Source: http://www.ups.com/content/us/en/resources/ship/imp_exp/operation.html
---
months:
1:
- name: New Year's Day
regions: [ups]
mday: 1
observed: to_weekday_if_weekend(date)
5:
- name: Memorial Day
week: -1
regions: [ups]
wday: 1
7:
- name: Independence Day
regions: [ups]
mday: 4
observed: to_weekday_if_weekend(date)
9:
- name: Labor Day
week: 1
regions: [ups]
wday: 1
11:
- name: Thanksgiving
week: 4
regions: [ups]
wday: 4
- name: Day After Thanksgiving
function: day_after_thanksgiving(year)
regions: [ups]
12:
- name: Christmas Day
regions: [ups]
mday: 25
observed: to_weekday_if_weekend(date)
- name: New Year's Eve
regions: [ups]
mday: 31
methods:
day_after_thanksgiving:
arguments: year
ruby: |
Holidays::Factory::DateCalculator.day_of_month_calculator.call(year, 11, 4, 4) + 1
tests:
- given:
date: '2008-01-01'
regions: ["ups"]
expect:
name: "New Year's Day"
- given:
date: '2008-05-26'
regions: ["ups"]
expect:
name: "Memorial Day"
- given:
date: '2008-07-04'
regions: ["ups"]
expect:
name: "Independence Day"
- given:
date: '2008-09-01'
regions: ["ups"]
expect:
name: "Labor Day"
- given:
date: '2008-11-27'
regions: ["ups"]
expect:
name: "Thanksgiving"
- given:
date: '2008-11-28'
regions: ["ups"]
expect:
name: "Day After Thanksgiving"
- given:
date: '2013-11-28'
regions: ["ups"]
expect:
name: "Thanksgiving"
- given:
date: '2013-11-29'
regions: ["ups"]
expect:
name: "Day After Thanksgiving"
- given:
date: '2008-12-25'
regions: ["ups"]
expect:
name: "Christmas Day"
- given:
date: '2008-12-31'
regions: ["ups"]
expect:
name: "New Year's Eve"