bjeanes-holidays 0.9.5
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +15 -0
- data/LICENSE +21 -0
- data/README.rdoc +77 -0
- data/REFERENCES +16 -0
- data/data/SYNTAX +111 -0
- data/data/au.yaml +111 -0
- data/data/build_defs.rb +152 -0
- data/data/ca.yaml +141 -0
- data/data/de.yaml +111 -0
- data/data/dk.yaml +117 -0
- data/data/es.yaml +161 -0
- data/data/fr.yaml +70 -0
- data/data/gb.yaml +106 -0
- data/data/ie.yaml +58 -0
- data/data/index.yaml +23 -0
- data/data/is.yaml +136 -0
- data/data/it.yaml +66 -0
- data/data/mx.yaml +106 -0
- data/data/nl.yaml +67 -0
- data/data/north_america_informal.yaml +49 -0
- data/data/nyse.yaml +63 -0
- data/data/pt.yaml +85 -0
- data/data/se.yaml +91 -0
- data/data/united_nations.yaml +188 -0
- data/data/ups.yaml +56 -0
- data/data/us.yaml +81 -0
- data/data/za.yaml +78 -0
- data/lib/holidays.rb +404 -0
- data/lib/holidays/MANIFEST +25 -0
- data/lib/holidays/au.rb +42 -0
- data/lib/holidays/ca.rb +68 -0
- data/lib/holidays/de.rb +50 -0
- data/lib/holidays/dk.rb +47 -0
- data/lib/holidays/es.rb +52 -0
- data/lib/holidays/europe.rb +214 -0
- data/lib/holidays/fr.rb +36 -0
- data/lib/holidays/gb.rb +40 -0
- data/lib/holidays/ie.rb +32 -0
- data/lib/holidays/is.rb +61 -0
- data/lib/holidays/it.rb +35 -0
- data/lib/holidays/mx.rb +51 -0
- data/lib/holidays/nl.rb +36 -0
- data/lib/holidays/north_america.rb +107 -0
- data/lib/holidays/nyse.rb +32 -0
- data/lib/holidays/pt.rb +43 -0
- data/lib/holidays/scandinavia.rb +114 -0
- data/lib/holidays/se.rb +52 -0
- data/lib/holidays/united_nations.rb +24 -0
- data/lib/holidays/ups.rb +31 -0
- data/lib/holidays/us.rb +48 -0
- data/lib/holidays/za.rb +35 -0
- data/rakefile.rb +150 -0
- data/test/defs/test_defs_au.rb +36 -0
- data/test/defs/test_defs_ca.rb +29 -0
- data/test/defs/test_defs_de.rb +49 -0
- data/test/defs/test_defs_dk.rb +30 -0
- data/test/defs/test_defs_es.rb +57 -0
- data/test/defs/test_defs_europe.rb +243 -0
- data/test/defs/test_defs_fr.rb +26 -0
- data/test/defs/test_defs_gb.rb +36 -0
- data/test/defs/test_defs_ie.rb +21 -0
- data/test/defs/test_defs_is.rb +33 -0
- data/test/defs/test_defs_it.rb +25 -0
- data/test/defs/test_defs_mx.rb +22 -0
- data/test/defs/test_defs_nl.rb +24 -0
- data/test/defs/test_defs_north_america.rb +54 -0
- data/test/defs/test_defs_nyse.rb +22 -0
- data/test/defs/test_defs_pt.rb +56 -0
- data/test/defs/test_defs_scandinavia.rb +75 -0
- data/test/defs/test_defs_se.rb +32 -0
- data/test/defs/test_defs_ups.rb +21 -0
- data/test/defs/test_defs_us.rb +23 -0
- data/test/defs/test_defs_za.rb +25 -0
- metadata +132 -0
data/data/ca.yaml
ADDED
@@ -0,0 +1,141 @@
|
|
1
|
+
# Canadian holiday definitions for the Ruby Holiday gem.
|
2
|
+
# Updated 2008-11-21.
|
3
|
+
---
|
4
|
+
months:
|
5
|
+
0:
|
6
|
+
- name: Good Friday
|
7
|
+
regions: [ca]
|
8
|
+
function: easter(year)-2
|
9
|
+
- name: Easter Monday
|
10
|
+
regions: [ca]
|
11
|
+
function: easter(year)+1
|
12
|
+
type: informal
|
13
|
+
1:
|
14
|
+
- name: New Year's Day
|
15
|
+
regions: [ca]
|
16
|
+
mday: 1
|
17
|
+
- name: New Year's
|
18
|
+
regions: [ca_qc]
|
19
|
+
mday: 2
|
20
|
+
2:
|
21
|
+
- name: Family Day
|
22
|
+
regions: [ca_ab, ca_on, ca_sk]
|
23
|
+
wday: 1
|
24
|
+
week: 3
|
25
|
+
- name: Louis Riel Day
|
26
|
+
regions: [ca_mb]
|
27
|
+
wday: 1
|
28
|
+
week: 3
|
29
|
+
3:
|
30
|
+
- name: St. Patrick's Day
|
31
|
+
regions: [ca_nf]
|
32
|
+
mday: 17
|
33
|
+
3:
|
34
|
+
- name: St. George's Day
|
35
|
+
regions: [ca_nf]
|
36
|
+
mday: 23
|
37
|
+
5:
|
38
|
+
- name: Victoria Day
|
39
|
+
regions: [ca]
|
40
|
+
function: ca_victoria_day(year)
|
41
|
+
- name: National Patriotes Day
|
42
|
+
regions: [ca_qc]
|
43
|
+
function: ca_victoria_day(year)
|
44
|
+
6:
|
45
|
+
- name: Discovery Day
|
46
|
+
regions: [ca_nf]
|
47
|
+
mday: 24
|
48
|
+
- name: Fête Nationale
|
49
|
+
regions: [ca_qc]
|
50
|
+
mday: 24
|
51
|
+
- name: National Aboriginal Day
|
52
|
+
regions: [ca_nt]
|
53
|
+
mday: 21
|
54
|
+
7:
|
55
|
+
- name: Canada Day
|
56
|
+
regions: [ca]
|
57
|
+
mday: 1
|
58
|
+
observed: to_monday_if_sunday
|
59
|
+
- name: Orangemen's Day
|
60
|
+
regions: [ca_nf]
|
61
|
+
mday: 12
|
62
|
+
- name: Nunavut Day
|
63
|
+
regions: [ca_nu]
|
64
|
+
mday: 9
|
65
|
+
8:
|
66
|
+
- name: BC Day
|
67
|
+
week: 1
|
68
|
+
regions: [ca_bc]
|
69
|
+
wday: 1
|
70
|
+
- name: Saskatchewan Day
|
71
|
+
week: 1
|
72
|
+
regions: [ca_sk]
|
73
|
+
wday: 1
|
74
|
+
- name: Heritage Day
|
75
|
+
week: 1
|
76
|
+
regions: [ca_ab]
|
77
|
+
wday: 1
|
78
|
+
- name: Natal Day
|
79
|
+
week: 1
|
80
|
+
regions: [ca_ns]
|
81
|
+
wday: 1
|
82
|
+
- name: Civic Holiday
|
83
|
+
week: 1
|
84
|
+
regions: [ca_on]
|
85
|
+
wday: 1
|
86
|
+
- name: Discovery Day
|
87
|
+
week: 3
|
88
|
+
regions: [ca_yk]
|
89
|
+
wday: 1
|
90
|
+
9:
|
91
|
+
- name: Labour Day
|
92
|
+
week: 1
|
93
|
+
regions: [ca]
|
94
|
+
wday: 1
|
95
|
+
10:
|
96
|
+
- name: Thanksgiving
|
97
|
+
week: 2
|
98
|
+
regions: [ca]
|
99
|
+
wday: 1
|
100
|
+
11:
|
101
|
+
- name: Rememberance Day
|
102
|
+
regions: [ca]
|
103
|
+
mday: 11
|
104
|
+
12:
|
105
|
+
- name: Christmas Day
|
106
|
+
regions: [ca]
|
107
|
+
mday: 25
|
108
|
+
- name: Boxing Day
|
109
|
+
regions: [ca]
|
110
|
+
mday: 26
|
111
|
+
methods:
|
112
|
+
ca_victoria_day: |
|
113
|
+
# Monday on or before May 24
|
114
|
+
def self.ca_victoria_day(year)
|
115
|
+
date = Date.civil(year,5,24)
|
116
|
+
if date.wday > 1
|
117
|
+
date -= (date.wday - 1)
|
118
|
+
elsif date.wday == 0
|
119
|
+
date -= 6
|
120
|
+
end
|
121
|
+
date
|
122
|
+
end
|
123
|
+
tests: |
|
124
|
+
{Date.civil(2008,1,1) => 'New Year\'s Day',
|
125
|
+
Date.civil(2008,3,21) => 'Good Friday',
|
126
|
+
Date.civil(2008,3,24) => 'Easter Monday',
|
127
|
+
Date.civil(2008,5,19) => 'Victoria Day',
|
128
|
+
Date.civil(2008,7,1) => 'Canada Day',
|
129
|
+
Date.civil(2008,9,1) => 'Labour Day',
|
130
|
+
Date.civil(2008,10,13) => 'Thanksgiving',
|
131
|
+
Date.civil(2008,11,11) => 'Rememberance Day',
|
132
|
+
Date.civil(2008,12,25) => 'Christmas Day',
|
133
|
+
Date.civil(2008,12,26) => 'Boxing Day'}.each do |date, name|
|
134
|
+
assert_equal name, Holidays.on(date, :ca, :informal)[0][:name]
|
135
|
+
end
|
136
|
+
|
137
|
+
# Victoria Day
|
138
|
+
[Date.civil(2004,5,24), Date.civil(2005,5,23), Date.civil(2006,5,22),
|
139
|
+
Date.civil(2007,5,21), Date.civil(2008,5,19)].each do |date|
|
140
|
+
assert_equal 'Victoria Day', Holidays.on(date, :ca)[0][:name]
|
141
|
+
end
|
data/data/de.yaml
ADDED
@@ -0,0 +1,111 @@
|
|
1
|
+
# German holiday definitions for the Ruby Holiday gem.
|
2
|
+
#
|
3
|
+
# Updated: 2009-11-05.
|
4
|
+
# Sources:
|
5
|
+
# - http://en.wikipedia.org/wiki/Holidays_in_Germany
|
6
|
+
# - http://www.timeanddate.com/calendar/index.html?country=8
|
7
|
+
# - http://www.germany.info/relaunch/welcome/travel/holidays.html
|
8
|
+
---
|
9
|
+
months:
|
10
|
+
0:
|
11
|
+
- name: Karfreitag
|
12
|
+
regions: [de]
|
13
|
+
function: easter(year)-2
|
14
|
+
- name: Ostermontag
|
15
|
+
regions: [de]
|
16
|
+
function: easter(year)+1
|
17
|
+
- name: Christi Himmelfahrt
|
18
|
+
regions: [de]
|
19
|
+
function: easter(year)+39
|
20
|
+
- name: Pfingstmontag
|
21
|
+
regions: [de]
|
22
|
+
function: easter(year)+50
|
23
|
+
- name: Fronleichnam
|
24
|
+
regions: [de_bw, de_by, de_he, de_nw, de_rp, de_sl]
|
25
|
+
function: easter(year)+60
|
26
|
+
1:
|
27
|
+
- name: Neujahrstag
|
28
|
+
regions: [de]
|
29
|
+
mday: 1
|
30
|
+
- name: Heilige Drei Könige
|
31
|
+
regions: [de_bw, de_by, de_st]
|
32
|
+
mday: 6
|
33
|
+
5:
|
34
|
+
- name: Tag der Arbeit
|
35
|
+
regions: [de]
|
36
|
+
mday: 1
|
37
|
+
8:
|
38
|
+
- name: Mariä Himmelfahrt
|
39
|
+
regions: [de_by, de_sl]
|
40
|
+
mday: 15
|
41
|
+
10:
|
42
|
+
- name: Tag der Deutschen Einheit
|
43
|
+
regions: [de]
|
44
|
+
mday: 3
|
45
|
+
- name: Reformationstag
|
46
|
+
regions: [de_bb, de_mv, de_sn, de_st, de_th]
|
47
|
+
mday: 31
|
48
|
+
11:
|
49
|
+
- name: Allerheiligen
|
50
|
+
regions: [de_bw, de_by, de_nw, de_rp, de_sl]
|
51
|
+
mday: 1
|
52
|
+
- name: Buß- und Bettag
|
53
|
+
regions: [de_sn]
|
54
|
+
function: de_buss_und_bettag(year)
|
55
|
+
12:
|
56
|
+
- name: 1. Weihnachtstag
|
57
|
+
regions: [de]
|
58
|
+
mday: 25
|
59
|
+
- name: 2. Weihnachtstag
|
60
|
+
regions: [de]
|
61
|
+
mday: 26
|
62
|
+
methods:
|
63
|
+
de_buss_und_bettag: |
|
64
|
+
# Germany: Wednesday before November 23
|
65
|
+
def self.de_buss_und_bettag(year)
|
66
|
+
date = Date.civil(year,11,23)
|
67
|
+
if date.wday > 3
|
68
|
+
date -= (date.wday - 3)
|
69
|
+
else
|
70
|
+
date -= (date.wday + 4)
|
71
|
+
end
|
72
|
+
date
|
73
|
+
end
|
74
|
+
tests: |
|
75
|
+
{Date.civil(2009,1,1) => 'Neujahrstag',
|
76
|
+
Date.civil(2009,4,10) => 'Karfreitag',
|
77
|
+
Date.civil(2009,4,13) => 'Ostermontag',
|
78
|
+
Date.civil(2009,5,1) => 'Tag der Arbeit',
|
79
|
+
Date.civil(2009,5,21) => 'Christi Himmelfahrt',
|
80
|
+
Date.civil(2009,6,1) => 'Pfingstmontag',
|
81
|
+
Date.civil(2009,10,3) => 'Tag der Deutschen Einheit',
|
82
|
+
Date.civil(2009,12,25) => '1. Weihnachtstag',
|
83
|
+
Date.civil(2009,12,26) => '2. Weihnachtstag'}.each do |date, name|
|
84
|
+
assert_equal name, Holidays.on(date, :de, :informal)[0][:name]
|
85
|
+
end
|
86
|
+
|
87
|
+
[:de_bw, :de_by, :de_st, :de_].each do |r|
|
88
|
+
assert_equal 'Heilige Drei Könige', Date.civil(2009,1,6).holidays(r)[0][:name]
|
89
|
+
end
|
90
|
+
|
91
|
+
[:de_bw, :de_by, :de_he, :de_nw, :de_rp, :de_sl, :de_].each do |r|
|
92
|
+
assert_equal 'Fronleichnam', Date.civil(2009,6,11).holidays(r)[0][:name]
|
93
|
+
end
|
94
|
+
|
95
|
+
[:de_by, :de_sl, :de_].each do |r|
|
96
|
+
assert_equal 'Mariä Himmelfahrt', Date.civil(2009,8,15).holidays(r)[0][:name]
|
97
|
+
end
|
98
|
+
|
99
|
+
[:de_bb, :de_mv, :de_sn, :de_st, :de_th, :de_].each do |r|
|
100
|
+
assert_equal 'Reformationstag', Date.civil(2009,10,31).holidays(r)[0][:name]
|
101
|
+
end
|
102
|
+
|
103
|
+
[:de_bw, :de_by, :de_nw, :de_rp, :de_sl, :de_].each do |r|
|
104
|
+
assert_equal 'Allerheiligen', Date.civil(2009,11,1).holidays(r)[0][:name]
|
105
|
+
end
|
106
|
+
|
107
|
+
# Repentance Day
|
108
|
+
assert_equal 'Buß- und Bettag', Date.civil(2004,11,17).holidays(:de_sn)[0][:name]
|
109
|
+
assert_equal 'Buß- und Bettag', Date.civil(2005,11,16).holidays(:de_sn)[0][:name]
|
110
|
+
assert_equal 'Buß- und Bettag', Date.civil(2006,11,22).holidays(:de_sn)[0][:name]
|
111
|
+
assert_equal 'Buß- und Bettag', Date.civil(2009,11,18).holidays(:de_sn)[0][:name]
|
data/data/dk.yaml
ADDED
@@ -0,0 +1,117 @@
|
|
1
|
+
# Danish holiday definitions for the Ruby Holiday gem.
|
2
|
+
#
|
3
|
+
# Updated: 2008-11-22.
|
4
|
+
# Sources:
|
5
|
+
# - http://en.wikipedia.org/wiki/Holidays_in_Denmark
|
6
|
+
# - http://www.amblondon.um.dk/en/menu/AboutDenmark/PublicHolidaysInDK/PublicHolidaysinDenmark-until2010.htm
|
7
|
+
# - http://borger.dk/forside/kirke-og-tro/folkekirken/officielle-helligdage
|
8
|
+
---
|
9
|
+
months:
|
10
|
+
0:
|
11
|
+
- name: Fastelavn
|
12
|
+
regions: [dk]
|
13
|
+
function: easter(year)-49
|
14
|
+
type: informal
|
15
|
+
- name: Palmesøndag
|
16
|
+
regions: [dk]
|
17
|
+
function: easter(year)-7
|
18
|
+
- name: Skærtorsdag
|
19
|
+
regions: [dk]
|
20
|
+
function: easter(year)-3
|
21
|
+
- name: Langfredag
|
22
|
+
regions: [dk]
|
23
|
+
function: easter(year)-2
|
24
|
+
- name: Påskedag
|
25
|
+
regions: [dk]
|
26
|
+
function: easter(year)
|
27
|
+
- name: 2. påskedag
|
28
|
+
regions: [dk]
|
29
|
+
function: easter(year)+1
|
30
|
+
- name: Store Bededag
|
31
|
+
regions: [dk]
|
32
|
+
function: easter(year)+26
|
33
|
+
- name: Kristi Himmelfartsdag
|
34
|
+
regions: [dk]
|
35
|
+
function: easter(year)+39
|
36
|
+
- name: Pinsedag
|
37
|
+
regions: [dk]
|
38
|
+
function: easter(year)+49
|
39
|
+
- name: 2. Pinsedag
|
40
|
+
regions: [dk]
|
41
|
+
function: easter(year)+50
|
42
|
+
1:
|
43
|
+
- name: Nytårsdag
|
44
|
+
regions: [dk]
|
45
|
+
mday: 1
|
46
|
+
4:
|
47
|
+
- name: 1. april
|
48
|
+
regions: [dk]
|
49
|
+
mday: 1
|
50
|
+
type: informal
|
51
|
+
- name: Danmarks besættelse
|
52
|
+
regions: [dk]
|
53
|
+
mday: 9
|
54
|
+
type: informal
|
55
|
+
- name: Dronningens fødselsdag
|
56
|
+
regions: [dk]
|
57
|
+
mday: 16
|
58
|
+
type: informal
|
59
|
+
5:
|
60
|
+
- name: Arbejdernes kampdag
|
61
|
+
regions: [dk]
|
62
|
+
mday: 1
|
63
|
+
- name: Danmarks befrielse
|
64
|
+
regions: [dk]
|
65
|
+
mday: 5
|
66
|
+
type: informal
|
67
|
+
6:
|
68
|
+
- name: Grundlovsdag
|
69
|
+
regions: [dk]
|
70
|
+
mday: 5
|
71
|
+
- name: Valdemarsdag og Genforeningsdag
|
72
|
+
regions: [dk]
|
73
|
+
mday: 15
|
74
|
+
type: informal
|
75
|
+
- name: Sankt Hans aften
|
76
|
+
regions: [dk]
|
77
|
+
mday: 23
|
78
|
+
type: informal
|
79
|
+
11:
|
80
|
+
- name: Mortensaften
|
81
|
+
regions: [dk]
|
82
|
+
mday: 10
|
83
|
+
type: informal
|
84
|
+
12:
|
85
|
+
- name: Sankt Lucia
|
86
|
+
regions: [dk]
|
87
|
+
mday: 13
|
88
|
+
type: informal
|
89
|
+
- name: Juleaftensdag
|
90
|
+
regions: [dk]
|
91
|
+
mday: 24
|
92
|
+
- name: 1. juledag
|
93
|
+
regions: [dk]
|
94
|
+
mday: 25
|
95
|
+
- name: 2. juledag
|
96
|
+
regions: [dk]
|
97
|
+
mday: 26
|
98
|
+
tests: |
|
99
|
+
{Date.civil(2007,1,1) => 'Nytårsdag',
|
100
|
+
Date.civil(2007,2,18) => 'Fastelavn',
|
101
|
+
Date.civil(2007,4,9) => 'Danmarks besættelse',
|
102
|
+
Date.civil(2007,4,16) => 'Dronningens fødselsdag',
|
103
|
+
Date.civil(2007,4,5) => 'Skærtorsdag',
|
104
|
+
Date.civil(2007,4,6) => 'Langfredag',
|
105
|
+
Date.civil(2007,4,8) => 'Påskedag',
|
106
|
+
Date.civil(2007,4,9) => '2. påskedag',
|
107
|
+
Date.civil(2007,5,1) => 'Arbejdernes kampdag',
|
108
|
+
Date.civil(2007,5,4) => 'Store Bededag',
|
109
|
+
Date.civil(2007,5,17) => 'Kristi Himmelfartsdag',
|
110
|
+
Date.civil(2007,5,27) => 'Pinsedag',
|
111
|
+
Date.civil(2007,5,28) => '2. Pinsedag',
|
112
|
+
Date.civil(2007,6,5) => 'Grundlovsdag',
|
113
|
+
Date.civil(2007,12,24) => 'Juleaftensdag',
|
114
|
+
Date.civil(2007,12,25) => '1. juledag',
|
115
|
+
Date.civil(2007,12,26) => '2. juledag'}.each do |date, name|
|
116
|
+
assert_equal name, Holidays.on(date, :dk, :informal)[0][:name]
|
117
|
+
end
|
data/data/es.yaml
ADDED
@@ -0,0 +1,161 @@
|
|
1
|
+
# Spanish holiday definitions for the Ruby Holiday gem.
|
2
|
+
#
|
3
|
+
# Including the Balearic Islands and the Canary Islands.
|
4
|
+
#
|
5
|
+
# Updated: 2008-11-29.
|
6
|
+
#
|
7
|
+
# Sources:
|
8
|
+
# - http://en.wikipedia.org/wiki/Public_holidays_in_Spain
|
9
|
+
# - http://www.timeanddate.com/calendar/index.html?country=16
|
10
|
+
#
|
11
|
+
# Notes:
|
12
|
+
# - Valencia is encoded as both es_v and es_vc
|
13
|
+
---
|
14
|
+
months:
|
15
|
+
0:
|
16
|
+
- name: Jueves Santo
|
17
|
+
regions: [es_pv, es_ct, es_na, es_v, es_vc]
|
18
|
+
function: easter(year)-3
|
19
|
+
- name: Viernes Santo
|
20
|
+
regions: [es]
|
21
|
+
function: easter(year)-2
|
22
|
+
- name: Lunes de Pascua
|
23
|
+
regions: [es_pv, es_ct, es_na, es_v, es_vc]
|
24
|
+
function: easter(year)+1
|
25
|
+
1:
|
26
|
+
- name: Año Nuevo
|
27
|
+
regions: [es]
|
28
|
+
mday: 1
|
29
|
+
- name: Día de Reyes
|
30
|
+
regions: [es]
|
31
|
+
mday: 6
|
32
|
+
2:
|
33
|
+
- name: Día de Andalucía
|
34
|
+
regions: [es_an]
|
35
|
+
mday: 28
|
36
|
+
3:
|
37
|
+
- name: Día de las Islas Baleares
|
38
|
+
regions: [es_ib]
|
39
|
+
mday: 1
|
40
|
+
- name: San José
|
41
|
+
regions: [es_v, es_vc, es_cm, es_mu, es_m]
|
42
|
+
mday: 19
|
43
|
+
4:
|
44
|
+
- name: San Jorge
|
45
|
+
regions: [es_ar, es_cl]
|
46
|
+
mday: 23
|
47
|
+
- name: Día de Aragón
|
48
|
+
regions: [es_ar]
|
49
|
+
mday: 23
|
50
|
+
5:
|
51
|
+
- name: Día del Trabajador
|
52
|
+
regions: [es]
|
53
|
+
mday: 1
|
54
|
+
- name: Fiesta de la Comunidad
|
55
|
+
regions: [es_m]
|
56
|
+
mday: 2
|
57
|
+
- name: Día de las Canarias
|
58
|
+
regions: [es_cn]
|
59
|
+
mday: 30
|
60
|
+
- name: Día de la Región Castilla-La Mancha
|
61
|
+
regions: [es_cm]
|
62
|
+
mday: 31
|
63
|
+
6:
|
64
|
+
- name: Día de la Región de Murcia
|
65
|
+
regions: [es_mu]
|
66
|
+
mday: 9
|
67
|
+
- name: Día de La Rioja
|
68
|
+
regions: [es_lo]
|
69
|
+
mday: 9
|
70
|
+
7:
|
71
|
+
- name: Santiago Apostol
|
72
|
+
regions: [es_ga]
|
73
|
+
mday: 23
|
74
|
+
8:
|
75
|
+
- name: Asunción
|
76
|
+
regions: [es]
|
77
|
+
mday: 15
|
78
|
+
9:
|
79
|
+
- name: Día de Ceuta
|
80
|
+
regions: [es_ce]
|
81
|
+
mday: 2
|
82
|
+
- name: Día de Asturias
|
83
|
+
regions: [es_o]
|
84
|
+
mday: 8
|
85
|
+
- name: Día de Extremadura
|
86
|
+
regions: [es_ex]
|
87
|
+
mday: 8
|
88
|
+
- name: Fiesta Nacional de Cataluña
|
89
|
+
regions: [es_ct]
|
90
|
+
mday: 11
|
91
|
+
10:
|
92
|
+
- name: Día de Valencia
|
93
|
+
regions: [es_vc, es_v]
|
94
|
+
mday: 9
|
95
|
+
- name: Día de la Hispanidad
|
96
|
+
regions: [es]
|
97
|
+
mday: 12
|
98
|
+
11:
|
99
|
+
- name: Todos los Santos
|
100
|
+
regions: [es]
|
101
|
+
mday: 1
|
102
|
+
12:
|
103
|
+
- name: Día de la Constitución
|
104
|
+
regions: [es]
|
105
|
+
mday: 6
|
106
|
+
- name: Inmaculada Concepción
|
107
|
+
regions: [es]
|
108
|
+
mday: 8
|
109
|
+
- name: Navidad del Señor
|
110
|
+
regions: [es]
|
111
|
+
mday: 25
|
112
|
+
- name: San Esteban
|
113
|
+
regions: [es_ib, es_ct]
|
114
|
+
mday: 26
|
115
|
+
tests: |
|
116
|
+
{Date.civil(2009,1,1) => 'Año Nuevo',
|
117
|
+
Date.civil(2009,1,6) => 'Día de Reyes',
|
118
|
+
Date.civil(2009,4,10) => 'Viernes Santo',
|
119
|
+
Date.civil(2009,5,1) => 'Día del Trabajador',
|
120
|
+
Date.civil(2009,8,15) => 'Asunción',
|
121
|
+
Date.civil(2009,10,12) => 'Día de la Hispanidad',
|
122
|
+
Date.civil(2009,11,1) => 'Todos los Santos',
|
123
|
+
Date.civil(2009,12,6) => 'Día de la Constitución',
|
124
|
+
Date.civil(2009,12,8) => 'Inmaculada Concepción',
|
125
|
+
Date.civil(2009,12,25) => 'Navidad del Señor'}.each do |date, name|
|
126
|
+
assert_equal name, Holidays.on(date, :es, :informal)[0][:name]
|
127
|
+
end
|
128
|
+
|
129
|
+
[:es_pv, :es_ct, :es_na, :es_v, :es_vc, :es_].each do |r|
|
130
|
+
assert_equal 'Jueves Santo', Date.civil(2009,4,9).holidays(r)[0][:name]
|
131
|
+
assert_equal 'Lunes de Pascua', Date.civil(2009,4,13).holidays(r)[0][:name]
|
132
|
+
end
|
133
|
+
|
134
|
+
[:es_v, :es_vc, :es_cm, :es_mu, :es_m, :es_].each do |r|
|
135
|
+
assert_equal 'San José', Date.civil(2009,3,19).holidays(r)[0][:name]
|
136
|
+
end
|
137
|
+
|
138
|
+
[:es_ar, :es_cl, :es_].each do |r|
|
139
|
+
assert_equal 'San Jorge', Date.civil(2009,4,23).holidays(r)[0][:name]
|
140
|
+
end
|
141
|
+
|
142
|
+
[:es_vc, :es_v, :es_].each do |r|
|
143
|
+
assert_equal 'Día de Valencia', Date.civil(2009,10,9).holidays(r)[0][:name]
|
144
|
+
end
|
145
|
+
|
146
|
+
[:es_ib, :es_ct, :es_].each do |r|
|
147
|
+
assert_equal 'San Esteban', Date.civil(2009,12,26).holidays(r)[0][:name]
|
148
|
+
end
|
149
|
+
|
150
|
+
assert_equal 'Día de Andalucía', Date.civil(2009,2,28).holidays(:es_an)[0][:name]
|
151
|
+
assert_equal 'Día de las Islas Baleares', Date.civil(2009,3,1).holidays(:es_ib)[0][:name]
|
152
|
+
assert_equal 'Fiesta de la Comunidad', Date.civil(2006,5,2).holidays(:es_m)[0][:name]
|
153
|
+
assert_equal 'Día de las Canarias', Date.civil(2006,5,30).holidays(:es_cn)[0][:name]
|
154
|
+
assert_equal 'Día de la Región Castilla-La Mancha', Date.civil(2009,5,31).holidays(:es_cm)[0][:name]
|
155
|
+
assert_equal 'Día de la Región de Murcia', Date.civil(2009,6,9).holidays(:es_mu)[0][:name]
|
156
|
+
assert_equal 'Día de La Rioja', Date.civil(2009,6,9).holidays(:es_lo)[0][:name]
|
157
|
+
assert_equal 'Santiago Apostol', Date.civil(2009,7,23).holidays(:es_ga)[0][:name]
|
158
|
+
assert_equal 'Día de Ceuta', Date.civil(2009,9,2).holidays(:es_ce)[0][:name]
|
159
|
+
assert_equal 'Día de Asturias', Date.civil(2009,9,8).holidays(:es_o)[0][:name]
|
160
|
+
assert_equal 'Día de Extremadura', Date.civil(2009,9,8).holidays(:es_ex)[0][:name]
|
161
|
+
assert_equal 'Fiesta Nacional de Cataluña', Date.civil(2009,9,11).holidays(:es_ct)[0][:name]
|