holidays/data/za.yaml

78 lines
2.0 KiB
YAML

# South African holiday definitions for the Ruby Holiday gem.
#
# Updated: 2008-11-29.
# Sources:
# - http://en.wikipedia.org/wiki/Public_holidays_in_South_Africa
# - http://www.info.gov.za/aboutsa/holidays.htm
---
months:
0:
- name: Good Friday
regions: [za]
function: easter(year)-2
- name: Family Day
regions: [za]
function: easter(year)+1
1:
- name: New Year's Day
regions: [za]
mday: 1
observed: to_monday_if_sunday
3:
- name: Human Rights Day
regions: [za]
mday: 21
observed: to_monday_if_sunday
4:
- name: Freedom Day
regions: [za]
mday: 27
observed: to_monday_if_sunday
5:
- name: Workers Day
regions: [za]
mday: 1
observed: to_monday_if_sunday
6:
- name: Youth Day
regions: [za]
mday: 16
observed: to_monday_if_sunday
8:
- name: National Women's Day
regions: [za]
mday: 9
observed: to_monday_if_sunday
9:
- name: Heritage Day
regions: [za]
mday: 24
observed: to_monday_if_sunday
12:
- name: Day of Reconciliation
regions: [za]
mday: 16
observed: to_monday_if_sunday
- name: Christmas Day
regions: [za]
mday: 25
observed: to_monday_if_sunday
- name: Day of Goodwill
regions: [za]
mday: 26
observed: to_weekday_if_boxing_weekend
tests: |
{Date.civil(2007,1,1) => 'New Year\'s Day',
Date.civil(2007,3,21) => 'Human Rights Day',
Date.civil(2007,4,6) => 'Good Friday',
Date.civil(2007,4,9) => 'Family Day',
Date.civil(2007,4,27) => 'Freedom Day',
Date.civil(2007,5,1) => 'Workers Day',
Date.civil(2007,6,16) => 'Youth Day',
Date.civil(2007,8,9) => 'National Women\'s Day',
Date.civil(2007,9,24) => 'Heritage Day',
Date.civil(2007,12,16) => 'Day of Reconciliation',
Date.civil(2007,12,25) => 'Christmas Day',
Date.civil(2007,12,26) => 'Day of Goodwill'}.each do |date, name|
assert_equal name, (Holidays.on(date, :za, :informal)[0] || {})[:name]
end