2007-11-23 02:01:11 +01:00
|
|
|
# South African holiday definitions for the Ruby Holiday gem.
|
|
|
|
#
|
2007-11-30 01:49:33 +01:00
|
|
|
# Updated: 2008-11-29.
|
2007-11-23 02:01:11 +01:00
|
|
|
# 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]
|
2007-11-29 03:24:00 +01:00
|
|
|
function: easter(year)-2
|
2007-11-23 02:01:11 +01:00
|
|
|
- name: Family Day
|
|
|
|
regions: [za]
|
2007-11-29 03:24:00 +01:00
|
|
|
function: easter(year)+1
|
2007-11-23 02:01:11 +01:00
|
|
|
1:
|
|
|
|
- name: New Year's Day
|
|
|
|
regions: [za]
|
|
|
|
mday: 1
|
2007-11-30 01:49:33 +01:00
|
|
|
observed: to_monday_if_sunday
|
2007-11-23 02:01:11 +01:00
|
|
|
3:
|
|
|
|
- name: Human Rights Day
|
|
|
|
regions: [za]
|
|
|
|
mday: 21
|
2007-11-30 01:49:33 +01:00
|
|
|
observed: to_monday_if_sunday
|
2007-11-23 02:01:11 +01:00
|
|
|
4:
|
|
|
|
- name: Freedom Day
|
|
|
|
regions: [za]
|
|
|
|
mday: 27
|
2007-11-30 01:49:33 +01:00
|
|
|
observed: to_monday_if_sunday
|
2007-11-23 02:01:11 +01:00
|
|
|
5:
|
2007-11-30 01:49:33 +01:00
|
|
|
- name: Workers Day
|
2007-11-23 02:01:11 +01:00
|
|
|
regions: [za]
|
|
|
|
mday: 1
|
2007-11-30 01:49:33 +01:00
|
|
|
observed: to_monday_if_sunday
|
2007-11-23 02:01:11 +01:00
|
|
|
6:
|
|
|
|
- name: Youth Day
|
|
|
|
regions: [za]
|
|
|
|
mday: 16
|
2007-11-30 01:49:33 +01:00
|
|
|
observed: to_monday_if_sunday
|
2007-11-23 02:01:11 +01:00
|
|
|
8:
|
|
|
|
- name: National Women's Day
|
|
|
|
regions: [za]
|
|
|
|
mday: 9
|
2007-11-30 01:49:33 +01:00
|
|
|
observed: to_monday_if_sunday
|
2007-11-23 02:01:11 +01:00
|
|
|
9:
|
|
|
|
- name: Heritage Day
|
|
|
|
regions: [za]
|
|
|
|
mday: 24
|
2007-11-30 01:49:33 +01:00
|
|
|
observed: to_monday_if_sunday
|
2007-11-23 02:01:11 +01:00
|
|
|
12:
|
|
|
|
- name: Day of Reconciliation
|
|
|
|
regions: [za]
|
|
|
|
mday: 16
|
2007-11-30 01:49:33 +01:00
|
|
|
observed: to_monday_if_sunday
|
2007-11-23 02:01:11 +01:00
|
|
|
- name: Christmas Day
|
|
|
|
regions: [za]
|
|
|
|
mday: 25
|
2007-11-30 01:49:33 +01:00
|
|
|
observed: to_monday_if_sunday
|
2007-11-23 02:01:11 +01:00
|
|
|
- name: Day of Goodwill
|
|
|
|
regions: [za]
|
|
|
|
mday: 26
|
2007-11-30 01:49:33 +01:00
|
|
|
observed: to_weekday_if_boxing_weekend
|
2007-12-05 23:27:05 +01:00
|
|
|
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
|