-
Notifications
You must be signed in to change notification settings - Fork 137
/
za.yaml
80 lines (80 loc) · 2.06 KB
/
za.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
# 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)
function_modifier: -2
- name: Family Day
regions: [za]
function: easter(year)
function_modifier: 1
1:
- name: New Year's Day
regions: [za]
mday: 1
observed: to_monday_if_sunday(date)
3:
- name: Human Rights Day
regions: [za]
mday: 21
observed: to_monday_if_sunday(date)
4:
- name: Freedom Day
regions: [za]
mday: 27
observed: to_monday_if_sunday(date)
5:
- name: Workers Day
regions: [za]
mday: 1
observed: to_monday_if_sunday(date)
6:
- name: Youth Day
regions: [za]
mday: 16
observed: to_monday_if_sunday(date)
8:
- name: National Women's Day
regions: [za]
mday: 9
observed: to_monday_if_sunday(date)
9:
- name: Heritage Day
regions: [za]
mday: 24
observed: to_monday_if_sunday(date)
12:
- name: Day of Reconciliation
regions: [za]
mday: 16
observed: to_monday_if_sunday(date)
- name: Christmas Day
regions: [za]
mday: 25
observed: to_monday_if_sunday(date)
- name: Day of Goodwill
regions: [za]
mday: 26
observed: to_weekday_if_boxing_weekend(date)
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