holidays 1.0.5 → 1.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.travis.yml +8 -1
- data/{CHANGELOG → CHANGELOG.rdoc} +29 -3
- data/LICENSE +2 -2
- data/README.rdoc +41 -28
- data/data/ar.yaml +82 -0
- data/data/au.yaml +40 -4
- data/data/be.yaml +65 -0
- data/data/br.yaml +12 -12
- data/data/ca.yaml +30 -17
- data/data/ch.yaml +187 -0
- data/data/federal_reserve.yaml +151 -0
- data/data/fi.yaml +19 -0
- data/data/fr.yaml +5 -5
- data/data/gb.yaml +19 -14
- data/data/hr.yaml +77 -0
- data/data/ie.yaml +36 -8
- data/data/index.yaml +12 -2
- data/data/ma.yaml +52 -0
- data/data/nerc.yaml +51 -0
- data/data/north_america_informal.yaml +13 -1
- data/data/pt.yaml +14 -13
- data/data/ro.yaml +76 -0
- data/data/sk.yaml +74 -0
- data/data/us.yaml +5 -1
- data/data/ve.yaml +70 -0
- data/holidays.gemspec +41 -9
- data/lib/holidays.rb +57 -34
- data/lib/holidays/MANIFEST +35 -24
- data/lib/holidays/ar.rb +42 -0
- data/lib/holidays/at.rb +3 -3
- data/lib/holidays/au.rb +28 -4
- data/lib/holidays/be.rb +40 -0
- data/lib/holidays/br.rb +1 -1
- data/lib/holidays/ca.rb +7 -3
- data/lib/holidays/ch.rb +92 -0
- data/lib/holidays/europe.rb +173 -53
- data/lib/holidays/federal_reserve.rb +50 -0
- data/lib/holidays/fi.rb +14 -1
- data/lib/holidays/fr.rb +1 -1
- data/lib/holidays/gb.rb +1 -1
- data/lib/holidays/hr.rb +42 -0
- data/lib/holidays/hu.rb +38 -0
- data/lib/holidays/ie.rb +16 -7
- data/lib/holidays/ma.rb +37 -0
- data/lib/holidays/mx.rb +3 -1
- data/lib/holidays/nerc.rb +34 -0
- data/lib/holidays/north_america.rb +9 -4
- data/lib/holidays/pt.rb +1 -1
- data/lib/holidays/ro.rb +40 -0
- data/lib/holidays/scandinavia.rb +13 -0
- data/lib/holidays/sk.rb +42 -0
- data/lib/holidays/us.rb +6 -3
- data/lib/holidays/ve.rb +40 -0
- data/rakefile.rb +1 -1
- data/test/defs/test_defs_ar.rb +27 -0
- data/test/defs/test_defs_au.rb +10 -0
- data/test/defs/test_defs_be.rb +25 -0
- data/test/defs/test_defs_br.rb +5 -5
- data/test/defs/test_defs_ca.rb +22 -2
- data/test/defs/test_defs_ch.rb +39 -0
- data/test/defs/test_defs_europe.rb +160 -10
- data/test/defs/test_defs_federal_reserve.rb +84 -0
- data/test/defs/test_defs_fi.rb +5 -0
- data/test/defs/test_defs_fr.rb +1 -1
- data/test/defs/test_defs_gb.rb +7 -2
- data/test/defs/test_defs_hr.rb +31 -0
- data/test/defs/test_defs_hu.rb +29 -0
- data/test/defs/test_defs_ie.rb +18 -3
- data/test/defs/test_defs_ma.rb +22 -0
- data/test/defs/test_defs_mx.rb +13 -0
- data/test/defs/test_defs_nerc.rb +23 -0
- data/test/defs/test_defs_north_america.rb +23 -2
- data/test/defs/test_defs_pt.rb +4 -3
- data/test/defs/test_defs_ro.rb +37 -0
- data/test/defs/test_defs_scandinavia.rb +5 -0
- data/test/defs/test_defs_sk.rb +28 -0
- data/test/defs/test_defs_us.rb +14 -0
- data/test/defs/test_defs_ve.rb +28 -0
- data/test/test_all_regions.rb +10 -0
- metadata +40 -6
data/data/fi.yaml
CHANGED
@@ -38,6 +38,9 @@ months:
|
|
38
38
|
regions: [fi]
|
39
39
|
mday: 1
|
40
40
|
6:
|
41
|
+
- name: Juhannusaatto
|
42
|
+
regions: [fi]
|
43
|
+
function: fi_juhannusaatto(year)
|
41
44
|
- name: Juhannuspäivä
|
42
45
|
regions: [fi]
|
43
46
|
function: fi_juhannuspaiva(year)
|
@@ -56,6 +59,17 @@ months:
|
|
56
59
|
regions: [fi]
|
57
60
|
mday: 26
|
58
61
|
methods:
|
62
|
+
fi_juhannusaatto: |
|
63
|
+
# Finland: Mid-summer eve (Friday between June 19–25)
|
64
|
+
def self.fi_juhannusaatto(year)
|
65
|
+
date = Date.civil(year,6,19)
|
66
|
+
if date.wday > 5 #if 19.6 is saturday
|
67
|
+
date += 6
|
68
|
+
else
|
69
|
+
date += (5 - date.wday)
|
70
|
+
end
|
71
|
+
date
|
72
|
+
end
|
59
73
|
fi_juhannuspaiva: |
|
60
74
|
# Finland: Mid-summer (Saturday between June 20–26)
|
61
75
|
def self.fi_juhannuspaiva(year)
|
@@ -79,6 +93,11 @@ tests: |
|
|
79
93
|
Date.civil(2008,5,1) => 'Vappu',
|
80
94
|
Date.civil(2008,5,1) => 'Helatorstai',
|
81
95
|
Date.civil(2008,5,11) => 'Helluntaipäivä',
|
96
|
+
Date.civil(2009,6,19) => 'Juhannusaatto',
|
97
|
+
Date.civil(2010,6,25) => 'Juhannusaatto',
|
98
|
+
Date.civil(2011,6,24) => 'Juhannusaatto',
|
99
|
+
Date.civil(2012,6,22) => 'Juhannusaatto',
|
100
|
+
Date.civil(2013,6,21) => 'Juhannusaatto',
|
82
101
|
Date.civil(2005,6,25) => 'Juhannuspäivä',
|
83
102
|
Date.civil(2006,6,24) => 'Juhannuspäivä',
|
84
103
|
Date.civil(2007,6,23) => 'Juhannuspäivä',
|
data/data/fr.yaml
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
# French holiday definitions for the Ruby Holiday gem.
|
2
2
|
#
|
3
|
-
# Updated:
|
3
|
+
# Updated: 2013-10-2*.
|
4
4
|
# Sources:
|
5
|
-
# - http://
|
6
|
-
# - http://
|
5
|
+
# - http://fr.wikipedia.org/wiki/Jours_f%C3%A9ri%C3%A9s_en_France#Les_f.C3.AAtes_f.C3.A9ri.C3.A9es
|
6
|
+
# - http://vosdroits.service-public.fr/particuliers/F2405.xhtml
|
7
7
|
---
|
8
8
|
months:
|
9
9
|
0:
|
@@ -49,7 +49,7 @@ months:
|
|
49
49
|
regions: [fr]
|
50
50
|
mday: 11
|
51
51
|
12:
|
52
|
-
- name:
|
52
|
+
- name: Noël
|
53
53
|
regions: [fr]
|
54
54
|
mday: 25
|
55
55
|
tests: |
|
@@ -65,6 +65,6 @@ tests: |
|
|
65
65
|
Date.civil(2007,8,15) => 'Assomption',
|
66
66
|
Date.civil(2007,11,1) => 'Toussaint',
|
67
67
|
Date.civil(2007,11,11) => 'Armistice 1918',
|
68
|
-
Date.civil(2007,12,25) => '
|
68
|
+
Date.civil(2007,12,25) => 'Noël'}.each do |date, name|
|
69
69
|
assert_equal name, (Holidays.on(date, :fr, :informal)[0] || {})[:name]
|
70
70
|
end
|
data/data/gb.yaml
CHANGED
@@ -4,15 +4,15 @@
|
|
4
4
|
# and Jersey.
|
5
5
|
#
|
6
6
|
# Updated: 2008-11-28.
|
7
|
-
# Sources:
|
7
|
+
# Sources:
|
8
8
|
# - http://en.wikipedia.org/wiki/List_of_holidays_by_country#United_Kingdom_and_Crown_dependencies
|
9
9
|
#
|
10
|
-
# Notes:
|
10
|
+
# Notes:
|
11
11
|
# - Jersey, Guernsey and the Isle of Man are encode with both their ISO 3166-1 and ISO 3-3166-2 codes.
|
12
12
|
# - England and Wales together should be encoded as [gb_eng, gb_wls, gb_eaw...]
|
13
|
-
---
|
13
|
+
---
|
14
14
|
months:
|
15
|
-
0:
|
15
|
+
0:
|
16
16
|
- name: Good Friday
|
17
17
|
regions: [gb]
|
18
18
|
function: easter(year)-2
|
@@ -22,21 +22,22 @@ months:
|
|
22
22
|
- name: Easter Monday
|
23
23
|
regions: [gb_eng, gb_wls, gb_eaw, gb_nir]
|
24
24
|
function: easter(year)+1
|
25
|
-
1:
|
25
|
+
1:
|
26
26
|
- name: New Year's Day
|
27
27
|
regions: [gb]
|
28
28
|
mday: 1
|
29
|
+
observed: to_monday_if_weekend
|
29
30
|
- name: New Year's
|
30
31
|
regions: [gb_sct]
|
31
32
|
mday: 2
|
32
|
-
3:
|
33
|
+
3:
|
33
34
|
- name: St. Piran's Day
|
34
35
|
regions: [gb_con]
|
35
36
|
mday: 5
|
36
37
|
- name: St. Patrick's Day
|
37
38
|
regions: [gb_nir]
|
38
39
|
mday: 17
|
39
|
-
5:
|
40
|
+
5:
|
40
41
|
- name: May Day
|
41
42
|
regions: [gb]
|
42
43
|
week: 1
|
@@ -48,14 +49,14 @@ months:
|
|
48
49
|
regions: [gb]
|
49
50
|
week: -1
|
50
51
|
wday: 1
|
51
|
-
7:
|
52
|
+
7:
|
52
53
|
- name: Tynwald Day
|
53
54
|
regions: [im, gb_iom]
|
54
55
|
mday: 5
|
55
56
|
- name: Battle of the Boyne
|
56
57
|
regions: [gb_nir]
|
57
58
|
mday: 12
|
58
|
-
8:
|
59
|
+
8:
|
59
60
|
- name: Bank Holiday
|
60
61
|
regions: [gb_sct]
|
61
62
|
week: 1
|
@@ -64,12 +65,12 @@ months:
|
|
64
65
|
regions: [gb_eng, gb_wls, gb_eaw, gb_nir]
|
65
66
|
week: -1
|
66
67
|
wday: 1
|
67
|
-
11:
|
68
|
+
11:
|
68
69
|
- name: Guy Fawkes Day
|
69
70
|
regions: [gb]
|
70
71
|
mday: 5
|
71
72
|
type: informal
|
72
|
-
12:
|
73
|
+
12:
|
73
74
|
- name: Christmas Day
|
74
75
|
regions: [gb]
|
75
76
|
mday: 25
|
@@ -79,8 +80,7 @@ months:
|
|
79
80
|
mday: 26
|
80
81
|
observed: to_weekday_if_boxing_weekend
|
81
82
|
tests: |
|
82
|
-
{Date.civil(2008,
|
83
|
-
Date.civil(2008,3,21) => 'Good Friday',
|
83
|
+
{Date.civil(2008,3,21) => 'Good Friday',
|
84
84
|
Date.civil(2008,3,23) => 'Easter Sunday',
|
85
85
|
Date.civil(2008,5,5) => 'May Day',
|
86
86
|
Date.civil(2008,5,26) => 'Bank Holiday',
|
@@ -99,8 +99,13 @@ tests: |
|
|
99
99
|
assert_equal 'Boxing Day', Date.civil(2008,12,26).holidays(:gb_, :observed)[0][:name]
|
100
100
|
assert_equal 'Boxing Day', Date.civil(2009,12,28).holidays(:gb_, :observed)[0][:name]
|
101
101
|
assert_equal 'Boxing Day', Date.civil(2010,12,28).holidays(:gb_, :observed)[0][:name]
|
102
|
+
assert_equal 'Boxing Day', Date.civil(2011,12,27).holidays(:gb_, :observed)[0][:name]
|
103
|
+
|
104
|
+
assert_equal 'New Year\'s Day', Date.civil(2010,1,1).holidays(:gb, :observed)[0][:name]
|
105
|
+
assert_equal 'New Year\'s Day', Date.civil(2011,1,3).holidays(:gb, :observed)[0][:name]
|
106
|
+
assert_equal 'New Year\'s Day', Date.civil(2012,1,2).holidays(:gb, :observed)[0][:name]
|
102
107
|
|
103
108
|
[:gb_wls, :gb_eng, :gb_nir, :gb_eaw, :gb_].each do |r|
|
104
109
|
assert_equal 'Easter Monday', Date.civil(2008,3,24).holidays(r)[0][:name]
|
105
110
|
assert_equal 'Bank Holiday', Date.civil(2008,8,25).holidays(r)[0][:name]
|
106
|
-
end
|
111
|
+
end
|
data/data/hr.yaml
ADDED
@@ -0,0 +1,77 @@
|
|
1
|
+
# Croatian holiday definitions for the Ruby Holiday gem.
|
2
|
+
#
|
3
|
+
# Updated: 2012-08-29.
|
4
|
+
# Sources:
|
5
|
+
# http://en.wikipedia.org/wiki/Public_holidays_in_Croatia
|
6
|
+
---
|
7
|
+
months:
|
8
|
+
0:
|
9
|
+
- name: Uskrs
|
10
|
+
regions: [hr]
|
11
|
+
function: easter(year)
|
12
|
+
- name: Uskrsni ponedjeljak
|
13
|
+
regions: [hr]
|
14
|
+
function: easter(year)+1
|
15
|
+
- name: Tijelovo
|
16
|
+
regions: [hr]
|
17
|
+
function: easter(year)+60
|
18
|
+
1:
|
19
|
+
- name: Nova godina
|
20
|
+
regions: [hr]
|
21
|
+
mday: 1
|
22
|
+
- name: Sveta tri kralja
|
23
|
+
regions: [hr]
|
24
|
+
mday: 6
|
25
|
+
5:
|
26
|
+
- name: Međunarodni praznik rada
|
27
|
+
regions: [hr]
|
28
|
+
mday: 1
|
29
|
+
6:
|
30
|
+
- name: Dan antifašističke borbe
|
31
|
+
regions: [hr]
|
32
|
+
mday: 22
|
33
|
+
- name: Dan državnosti
|
34
|
+
regions: [hr]
|
35
|
+
mday: 25
|
36
|
+
8:
|
37
|
+
- name: Dan pobjede i domovinske zahvalnosti i dan hrvatskih branitelja
|
38
|
+
regions: [hr]
|
39
|
+
mday: 5
|
40
|
+
- name: Velika Gospa
|
41
|
+
regions: [hr]
|
42
|
+
mday: 15
|
43
|
+
10:
|
44
|
+
- name: Dan neovisnosti
|
45
|
+
regions: [hr]
|
46
|
+
mday: 8
|
47
|
+
11:
|
48
|
+
- name: Dan svih svetih
|
49
|
+
regions: [hr]
|
50
|
+
mday: 1
|
51
|
+
12:
|
52
|
+
- name: Božić
|
53
|
+
regions: [hr]
|
54
|
+
mday: 25
|
55
|
+
- name: Sveti Stjepan
|
56
|
+
regions: [hr]
|
57
|
+
mday: 26
|
58
|
+
tests: |
|
59
|
+
{Date.civil(2012,1,1) => 'Nova godina',
|
60
|
+
Date.civil(2012,1,6) => 'Sveta tri kralja',
|
61
|
+
Date.civil(2012,5,1) => 'Međunarodni praznik rada',
|
62
|
+
Date.civil(2012,6,22) => 'Dan antifašističke borbe',
|
63
|
+
Date.civil(2012,6,25) => 'Dan državnosti',
|
64
|
+
Date.civil(2012,8,5) => 'Dan pobjede i domovinske zahvalnosti i dan hrvatskih branitelja',
|
65
|
+
Date.civil(2012,8,15) => 'Velika Gospa',
|
66
|
+
Date.civil(2012,10,8) => 'Dan neovisnosti',
|
67
|
+
Date.civil(2012,11,1) => 'Dan svih svetih',
|
68
|
+
Date.civil(2012,12,25) => 'Božić',
|
69
|
+
Date.civil(2012,12,26) => 'Sveti Stjepan'}.each do |date, name|
|
70
|
+
assert_equal name, (Holidays.on(date, :hr, :informal)[0] || {})[:name]
|
71
|
+
end
|
72
|
+
|
73
|
+
# Tijelovo
|
74
|
+
[Date.civil(2008,5,22), Date.civil(2009,6,11), Date.civil(2010,6,3),
|
75
|
+
Date.civil(2012,6,7), Date.civil(2013,5,30), Date.civil(2014,6,19)].each do |date|
|
76
|
+
assert_equal 'Tijelovo', Holidays.on(date, :hr)[0][:name]
|
77
|
+
end
|
data/data/ie.yaml
CHANGED
@@ -1,9 +1,10 @@
|
|
1
1
|
# Ireland holiday definitions for the Ruby Holiday gem.
|
2
2
|
#
|
3
|
-
# Updated:
|
3
|
+
# Updated: 2012-03-16.
|
4
4
|
# Sources:
|
5
5
|
# - http://en.wikipedia.org/wiki/Public_holidays_in_the_Republic_of_Ireland
|
6
6
|
# - http://www.citizensinformation.ie/categories/employment/employment-rights-and-conditions/leave-and-holidays/public-holidays-in-ireland
|
7
|
+
# While there is mention that Jan 2 2012 was not officially a bank holiday, in reality very few businesses will not observe that date as a bank holiday
|
7
8
|
---
|
8
9
|
months:
|
9
10
|
0:
|
@@ -14,27 +15,29 @@ months:
|
|
14
15
|
- name: New Year's Day
|
15
16
|
regions: [ie]
|
16
17
|
mday: 1
|
18
|
+
observed: to_monday_if_weekend
|
17
19
|
3:
|
18
20
|
- name: St. Patrick's Day
|
19
21
|
regions: [ie]
|
20
22
|
mday: 17
|
23
|
+
observed: to_monday_if_weekend
|
21
24
|
5:
|
22
25
|
- name: May Day
|
23
26
|
regions: [ie]
|
24
27
|
week: 1
|
25
28
|
wday: 1
|
26
29
|
6:
|
27
|
-
- name: Bank Holiday
|
30
|
+
- name: June Bank Holiday
|
28
31
|
regions: [ie]
|
29
32
|
week: 1
|
30
33
|
wday: 1
|
31
34
|
8:
|
32
|
-
- name: Bank Holiday
|
35
|
+
- name: August Bank Holiday
|
33
36
|
regions: [ie]
|
34
37
|
week: 1
|
35
38
|
wday: 1
|
36
39
|
10:
|
37
|
-
- name: Bank Holiday
|
40
|
+
- name: October Bank Holiday
|
38
41
|
regions: [ie]
|
39
42
|
week: -1
|
40
43
|
wday: 1
|
@@ -42,17 +45,42 @@ months:
|
|
42
45
|
- name: Christmas Day
|
43
46
|
regions: [ie]
|
44
47
|
mday: 25
|
48
|
+
observed: to_monday_if_weekend
|
45
49
|
- name: St. Stephen's Day
|
46
50
|
regions: [ie]
|
47
51
|
mday: 26
|
52
|
+
observed: ie_st_stephens_day
|
53
|
+
methods:
|
54
|
+
ie_st_stephens_day: |
|
55
|
+
# Ireland - Stephens Day is always the day after christmas day
|
56
|
+
def self.ie_st_stephens_day(date)
|
57
|
+
date += 2 if date.wday == 6
|
58
|
+
date += 2 if date.wday == 0
|
59
|
+
date += 1 if date.wday == 1
|
60
|
+
date
|
61
|
+
end
|
48
62
|
tests: |
|
49
63
|
{Date.civil(2008,1,1) => 'New Year\'s Day',
|
50
64
|
Date.civil(2008,3,17) => 'St. Patrick\'s Day',
|
51
65
|
Date.civil(2008,3,24) => 'Easter Monday',
|
52
66
|
Date.civil(2008,5,5) => 'May Day',
|
53
|
-
Date.civil(2008,6,2) => 'Bank Holiday',
|
54
|
-
Date.civil(2008,8,4) => 'Bank Holiday',
|
67
|
+
Date.civil(2008,6,2) => 'June Bank Holiday',
|
68
|
+
Date.civil(2008,8,4) => 'August Bank Holiday',
|
69
|
+
Date.civil(2008,10,27) => 'October Bank Holiday',
|
55
70
|
Date.civil(2008,12,25) => 'Christmas Day',
|
56
71
|
Date.civil(2008,12,26) => 'St. Stephen\'s Day'}.each do |date, name|
|
57
|
-
assert_equal name, (Holidays.on(date, :ie
|
58
|
-
end
|
72
|
+
assert_equal name, (Holidays.on(date, :ie)[0] || {})[:name]
|
73
|
+
end
|
74
|
+
{Date.civil(2012,1,2) => 'New Year\'s Day',
|
75
|
+
Date.civil(2012,3,19) => 'St. Patrick\'s Day',
|
76
|
+
Date.civil(2012,4,9) => 'Easter Monday',
|
77
|
+
Date.civil(2012,5,7) => 'May Day',
|
78
|
+
Date.civil(2012,6,4) => 'June Bank Holiday',
|
79
|
+
Date.civil(2012,8,6) => 'August Bank Holiday',
|
80
|
+
Date.civil(2012,10,29) => 'October Bank Holiday',
|
81
|
+
Date.civil(2011,12,26) => 'Christmas Day',
|
82
|
+
Date.civil(2011,12,27) => 'St. Stephen\'s Day',
|
83
|
+
Date.civil(2012,12,25) => 'Christmas Day',
|
84
|
+
Date.civil(2012,12,26) => 'St. Stephen\'s Day'}.each do |date, name|
|
85
|
+
assert_equal name, (Holidays.on(date, :ie, :observed)[0] || {})[:name]
|
86
|
+
end
|
data/data/index.yaml
CHANGED
@@ -1,30 +1,38 @@
|
|
1
1
|
# Definition build list
|
2
|
-
---
|
2
|
+
---
|
3
3
|
defs:
|
4
|
+
AR: ['ar.yaml']
|
4
5
|
AT: ['at.yaml']
|
5
6
|
AU: ['au.yaml']
|
7
|
+
BE: ['be.yaml']
|
6
8
|
BR: ['br.yaml']
|
7
9
|
CA: ['ca.yaml', 'north_america_informal.yaml']
|
10
|
+
CH: ['ch.yaml']
|
8
11
|
CZ: ['cz.yaml']
|
9
12
|
DK: ['dk.yaml']
|
10
13
|
DE: ['de.yaml']
|
11
14
|
EL: ['el.yaml']
|
12
15
|
ES: ['es.yaml']
|
16
|
+
Federal_Reserve: ['federal_reserve.yaml']
|
13
17
|
FI: ['fi.yaml']
|
14
18
|
FR: ['fr.yaml']
|
15
19
|
GB: ['gb.yaml']
|
20
|
+
HR: ['hr.yaml']
|
16
21
|
HU: ['hu.yaml']
|
17
22
|
IE: ['ie.yaml']
|
18
23
|
IS: ['is.yaml']
|
19
24
|
IT: ['it.yaml']
|
20
25
|
LI: ['li.yaml']
|
26
|
+
MA: ['ma.yaml']
|
21
27
|
MX: ['mx.yaml', 'north_america_informal.yaml']
|
28
|
+
NERC: ['nerc.yaml']
|
22
29
|
NL: ['nl.yaml']
|
23
30
|
"NO": ['no.yaml']
|
24
31
|
NYSE: ['nyse.yaml']
|
25
32
|
NZ: ['nz.yaml']
|
26
33
|
PL: ['pl.yaml']
|
27
34
|
PT: ['pt.yaml']
|
35
|
+
RO: ['ro.yaml']
|
28
36
|
SE: ['se.yaml']
|
29
37
|
US: ['us.yaml', 'north_america_informal.yaml']
|
30
38
|
United_Nations: ['united_nations.yaml']
|
@@ -32,5 +40,7 @@ defs:
|
|
32
40
|
ZA: ['za.yaml']
|
33
41
|
North_America: ['ca.yaml', 'mx.yaml', 'us.yaml', 'north_america_informal.yaml']
|
34
42
|
Scandinavia: ['dk.yaml', 'is.yaml', 'no.yaml', 'se.yaml', 'fi.yaml']
|
35
|
-
Europe: ['at.yaml', 'cz.yaml', 'dk.yaml', 'de.yaml', 'el.yaml', 'es.yaml', 'fr.yaml', 'gb.yaml', 'hu.yaml', 'ie.yaml', 'is.yaml', 'it.yaml', 'li.yaml', 'nl.yaml', 'no.yaml', 'pl.yaml', 'pt.yaml']
|
43
|
+
Europe: ['at.yaml', 'be.yaml', 'ch.yaml', 'cz.yaml', 'dk.yaml', 'de.yaml', 'el.yaml', 'es.yaml', 'fr.yaml', 'gb.yaml', 'hr.yaml', 'hu.yaml', 'ie.yaml', 'is.yaml', 'it.yaml', 'li.yaml', 'nl.yaml', 'no.yaml', 'pl.yaml', 'pt.yaml', 'ro.yaml', 'sk.yaml']
|
36
44
|
JP: ['jp.yaml']
|
45
|
+
VE: ['ve.yaml']
|
46
|
+
SK: ['sk.yaml']
|
data/data/ma.yaml
ADDED
@@ -0,0 +1,52 @@
|
|
1
|
+
# Morocco holiday (incomplete)definitions for the Ruby Holiday gem.
|
2
|
+
#
|
3
|
+
# Updated: 2013-07-01.
|
4
|
+
# Some dates in Islamic Calendar are missing.
|
5
|
+
# Sources:
|
6
|
+
# - http://en.wikipedia.org/wiki/Public_holidays_in_Morocco
|
7
|
+
---
|
8
|
+
months:
|
9
|
+
1:
|
10
|
+
- name: Ras l' âm
|
11
|
+
regions: [ma]
|
12
|
+
mday: 1
|
13
|
+
- name: Takdim watikat al-istiqlal
|
14
|
+
regions: [ma]
|
15
|
+
mday: 11
|
16
|
+
5:
|
17
|
+
- name: Eid Ash-Shughl
|
18
|
+
regions: [ma]
|
19
|
+
mday: 1
|
20
|
+
7:
|
21
|
+
- name: Eid Al-Ârch
|
22
|
+
regions: [ma]
|
23
|
+
mday: 30
|
24
|
+
8:
|
25
|
+
- name: Zikra Oued Ed-Dahab
|
26
|
+
regions: [ma]
|
27
|
+
mday: 14
|
28
|
+
- name: Thawrat al malik wa shâab
|
29
|
+
regions: [ma]
|
30
|
+
mday: 20
|
31
|
+
- name: Eid Al Milad
|
32
|
+
regions: [ma]
|
33
|
+
mday: 21
|
34
|
+
11:
|
35
|
+
- name: Eid Al Massira Al Khadra
|
36
|
+
regions: [ma]
|
37
|
+
mday: 6
|
38
|
+
- name: Eid Al Istiqulal
|
39
|
+
regions: [ma]
|
40
|
+
mday: 18
|
41
|
+
tests: |
|
42
|
+
{Date.civil(2007,1,1) => 'Ras l\' âm',
|
43
|
+
Date.civil(2007,1,11) => 'Takdim watikat al-istiqlal',
|
44
|
+
Date.civil(2007,5,1) => 'Eid Ash-Shughl',
|
45
|
+
Date.civil(2007,7,30) => 'Eid Al-Ârch',
|
46
|
+
Date.civil(2007,8,14) => 'Zikra Oued Ed-Dahab',
|
47
|
+
Date.civil(2007,8,20) => 'Thawrat al malik wa shâab',
|
48
|
+
Date.civil(2007,8,21) => 'Eid Al Milad',
|
49
|
+
Date.civil(2007,11,6) => 'Eid Al Massira Al Khadra',
|
50
|
+
Date.civil(2007,11,18) => 'Eid Al Istiqulal'}.each do |date, name|
|
51
|
+
assert_equal name, (Holidays.on(date, :ma, :informal)[0] || {})[:name]
|
52
|
+
end
|
data/data/nerc.yaml
ADDED
@@ -0,0 +1,51 @@
|
|
1
|
+
# NERC holiday definitions for the Ruby Holiday gem.
|
2
|
+
#
|
3
|
+
# By Adam Strickland
|
4
|
+
# Source: www.nerc.com/docs/oc/rs/Additional_Off-peak_Days.doc
|
5
|
+
#
|
6
|
+
# Updated 2013-01-03.
|
7
|
+
---
|
8
|
+
months:
|
9
|
+
1:
|
10
|
+
- name: New Year's Day
|
11
|
+
regions: [nerc]
|
12
|
+
mday: 1
|
13
|
+
observed: to_monday_if_sunday
|
14
|
+
5:
|
15
|
+
- name: Memorial Day
|
16
|
+
week: -1
|
17
|
+
regions: [nerc]
|
18
|
+
wday: 1
|
19
|
+
7:
|
20
|
+
- name: Independence Day
|
21
|
+
regions: [nerc]
|
22
|
+
mday: 4
|
23
|
+
observed: to_monday_if_sunday
|
24
|
+
9:
|
25
|
+
- name: Labor Day
|
26
|
+
week: 1
|
27
|
+
regions: [nerc]
|
28
|
+
wday: 1
|
29
|
+
11:
|
30
|
+
- name: Thanksgiving
|
31
|
+
week: 4
|
32
|
+
regions: [nerc]
|
33
|
+
wday: 4
|
34
|
+
12:
|
35
|
+
- name: Christmas Day
|
36
|
+
regions: [nerc]
|
37
|
+
mday: 25
|
38
|
+
observed: to_monday_if_sunday
|
39
|
+
methods:
|
40
|
+
tests: |
|
41
|
+
{Date.civil(2013,1,1) => 'New Year\'s Day',
|
42
|
+
Date.civil(2017,1,2) => 'New Year\'s Day',
|
43
|
+
Date.civil(2013,5,27) => 'Memorial Day',
|
44
|
+
Date.civil(2013,7,4) => 'Independence Day',
|
45
|
+
Date.civil(2010,7,5) => 'Independence Day',
|
46
|
+
Date.civil(2013,9,2) => 'Labor Day',
|
47
|
+
Date.civil(2013,11,28) => 'Thanksgiving',
|
48
|
+
Date.civil(2013,12,25) => 'Christmas Day',
|
49
|
+
Date.civil(2011,12,26) => 'Christmas Day'}.each do |date, name|
|
50
|
+
assert_equal name, (Holidays.on(date, :nerc, :observed)[0] || {})[:name]
|
51
|
+
end
|