holidays/data/ups.yaml

56 lines
1.3 KiB
YAML

# 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
5:
- name: Memorial Day
week: -1
regions: [ups]
wday: 1
7:
- name: Independence Day
regions: [ups]
mday: 4
observed: to_weekday_if_weekend
9:
- name: Labor Day
week: 1
regions: [ups]
wday: 1
11:
- name: Thanksgiving
week: 4
regions: [ups]
wday: 4
- name: Day After Thanksgiving
week: 4
regions: [ups]
wday: 5
12:
- name: Christmas Day
regions: [ups]
mday: 25
observed: to_weekday_if_weekend
- name: New Year's Eve
regions: [ups]
mday: 31
tests: |
{Date.civil(2008,1,1) => 'New Year\'s Day',
Date.civil(2008,5,26) => 'Memorial Day',
Date.civil(2008,7,4) => 'Independence Day',
Date.civil(2008,9,1) => 'Labor Day',
Date.civil(2008,11,27) => 'Thanksgiving',
Date.civil(2008,11,28) => 'Day After Thanksgiving',
Date.civil(2008,12,25) => 'Christmas Day',
Date.civil(2008,12,31) => 'New Year\'s Eve',}.each do |date, name|
assert_equal name, (Holidays.on(date, :ups)[0] || {})[:name]
end