-
Notifications
You must be signed in to change notification settings - Fork 137
/
fedex.yaml
62 lines (62 loc) · 1.59 KB
/
fedex.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
# FedEx holiday definitions for the Ruby Holiday gem.
#
# By Adam Runner
#
# Updated: 2015-03-09.
# Source: http://www.fedex.com/us/service-guide/holiday-schedule.html
---
months:
1:
- name: New Year's Day
regions: [fedex]
mday: 1
observed: to_weekday_if_weekend(date)
5:
- name: Memorial Day
week: -1
regions: [fedex]
wday: 1
7:
- name: Independence Day
regions: [fedex]
mday: 4
observed: to_weekday_if_weekend(date)
9:
- name: Labor Day
week: 1
regions: [fedex]
wday: 1
11:
- name: Thanksgiving
week: 4
regions: [fedex]
wday: 4
- name: Day After Thanksgiving
function: day_after_thanksgiving(year)
regions: [fedex]
12:
- name: Christmas Day
regions: [fedex]
mday: 25
observed: to_weekday_if_weekend(date)
- name: New Year's Eve
regions: [fedex]
mday: 31
methods:
day_after_thanksgiving:
arguments: year
source: |
Holidays::DateCalculatorFactory.day_of_month_calculator.call(year, 11, 4, 4) + 1
tests: |
{Date.civil(2015,1,1) => 'New Year\'s Day',
Date.civil(2015,5,25) => 'Memorial Day',
Date.civil(2015,7,4) => 'Independence Day',
Date.civil(2015,9,7) => 'Labor Day',
Date.civil(2015,11,26) => 'Thanksgiving',
Date.civil(2015,11,27) => 'Day After Thanksgiving',
Date.civil(2013,11,28) => 'Thanksgiving',
Date.civil(2013,11,29) => 'Day After Thanksgiving',
Date.civil(2015,12,25) => 'Christmas Day',
Date.civil(2015,12,31) => 'New Year\'s Eve',}.each do |date, name|
assert_equal name, (Holidays.on(date, :ups)[0] || {})[:name]
end