holidays 1.0.5 → 1.0.6
Sign up to get free protection for your applications and to get access to all the features.
- 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/.travis.yml
CHANGED
@@ -1,5 +1,31 @@
|
|
1
1
|
= Ruby Holidays Gem CHANGELOG
|
2
2
|
|
3
|
+
== 1.0.6
|
4
|
+
* Added `Holidays.regions` method (@sonnym)
|
5
|
+
* Added Slovakian definitions (@mirelon)
|
6
|
+
* Added Venezuelan definitions (@Chelo)
|
7
|
+
* Updated Canadian definitions (@sdavies)
|
8
|
+
* Updated Argentinian definitions (@popox)
|
9
|
+
* Updated Australian definitions (@ghiculescu)
|
10
|
+
* Updated Portuguese definitions (@MiPereira)
|
11
|
+
* Added Swiss definitions (@samzurcher, @jg)
|
12
|
+
* Added Romanian definitions (@mtarnovan)
|
13
|
+
* Added Belgian definitions (@jak78)
|
14
|
+
* Added Moroccan definitions (@jak78)
|
15
|
+
* Fixes for New Year's and Boxing Day (@iterion, @andyw8)
|
16
|
+
* Fixes for Father's Day, Mother's Day and Armed Forces Day (@eheikes)
|
17
|
+
* Typos (@gregoriokusowski, @popox)
|
18
|
+
* Added Croatian definitions (@lecterror)
|
19
|
+
* Added US Federal Reserve holidays (@willbarrett)
|
20
|
+
* Added NERC holidays (@adamstrickland)
|
21
|
+
* Updated Irish holidays (@xlcrs)
|
22
|
+
|
23
|
+
== 1.0.5
|
24
|
+
* Added `full_week?` method (@dceddia)
|
25
|
+
* Added Portuguese definitions (@pmor)
|
26
|
+
* Added Hungarian definitions (@spap)
|
27
|
+
* Typos (@DenisKnauf)
|
28
|
+
|
3
29
|
== 1.0.4
|
4
30
|
* Add Liechtenstein holiday defs (mercy vielmal Bernhard Furtmueller)
|
5
31
|
|
@@ -8,10 +34,10 @@
|
|
8
34
|
|
9
35
|
== 1.0.2
|
10
36
|
* Add `orthodox_easter` method and Greek holiday definitions (thanks https://github.com/ddimitriadis)
|
11
|
-
|
37
|
+
|
12
38
|
== 1.0.0
|
13
39
|
* Support calculating mday from negative weeks other than -1 (thanks http://github.com/bjeanes)
|
14
|
-
* Use class method to check leap years and fixed bug in Date.calculate_mday
|
40
|
+
* Use class method to check leap years and fixed bug in Date.calculate_mday
|
15
41
|
(thanks http://github.com/dgrambow)
|
16
42
|
* Added Czech (thanks http://github.com/boblin), Brazilian (http://github.com/fabiokr), Norwegian (thanks to Peter Skeide) and Australia/Brisbane (http://github.com/bjeanes) definitions
|
17
43
|
* Cleaned up rake and gemspec
|
@@ -28,4 +54,4 @@
|
|
28
54
|
* au.yaml was being included incorrectly in US holiday definitions. Thanks to Glenn Vanderburg (http://vanderburg.org/) for the fix.
|
29
55
|
|
30
56
|
== 0.9.0
|
31
|
-
* Initial release.
|
57
|
+
* Initial release.
|
data/LICENSE
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
==== Ruby Holidays Gem License
|
2
2
|
|
3
|
-
Copyright (c) 2007
|
3
|
+
Copyright (c) 2007, 2014 Alex Dunae
|
4
4
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
@@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
18
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
19
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
20
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
-
THE SOFTWARE.
|
21
|
+
THE SOFTWARE.
|
data/README.rdoc
CHANGED
@@ -1,80 +1,93 @@
|
|
1
1
|
= Ruby Holidays Gem
|
2
|
-
|
2
|
+
|
3
3
|
A set of functions to deal with holidays in Ruby.
|
4
|
-
|
4
|
+
|
5
5
|
Extends Ruby's built-in Date class and supports custom holiday definition lists.
|
6
|
-
|
6
|
+
|
7
7
|
=== Installation
|
8
|
-
|
8
|
+
|
9
9
|
To install the gem from RubyGems:
|
10
|
-
|
10
|
+
|
11
11
|
gem install holidays
|
12
|
-
|
12
|
+
|
13
|
+
The Holidays gem is tested on Ruby 1.8.7, 1.9.2, 1.9.3, 2.0.0, 2.1.0, REE and JRuby.
|
14
|
+
|
13
15
|
=== Time zones
|
14
16
|
|
15
17
|
Time zones are ignored. This library assumes that all dates are within the same time zone.
|
16
|
-
|
18
|
+
|
17
19
|
=== Examples
|
18
|
-
|
20
|
+
|
19
21
|
For more information, see the notes at the top of the Holidays module.
|
20
|
-
|
22
|
+
|
21
23
|
==== Using the Holidays class
|
22
24
|
Get all holidays on April 25, 2008 in Australia.
|
23
25
|
date = Date.civil(2008,4,25)
|
24
|
-
|
26
|
+
|
25
27
|
Holidays.on(date, :au)
|
26
28
|
=> [{:name => 'ANZAC Day',...}]
|
27
|
-
|
29
|
+
|
28
30
|
Get holidays that are observed on July 2, 2007 in British Columbia, Canada.
|
29
31
|
date = Date.civil(2007,7,2)
|
30
|
-
|
32
|
+
|
31
33
|
Holidays.on(date, :ca_bc, :observed)
|
32
34
|
=> [{:name => 'Canada Day',...}]
|
33
|
-
|
35
|
+
|
34
36
|
Get all holidays in July, 2008 in Canada and the US.
|
35
37
|
from = Date.civil(2008,7,1)
|
36
38
|
to = Date.civil(2008,7,31)
|
37
|
-
|
39
|
+
|
38
40
|
Holidays.between(from, to, :ca, :us)
|
39
41
|
=> [{:name => 'Canada Day',...}
|
40
42
|
{:name => 'Independence Day',...}]
|
41
|
-
|
43
|
+
|
42
44
|
Get informal holidays in February.
|
43
45
|
from = Date.civil(2008,2,1)
|
44
46
|
to = Date.civil(2008,2,15)
|
45
|
-
|
47
|
+
|
46
48
|
Holidays.between(from, to)
|
47
49
|
=> [{:name => 'Valentine\'s Day',...}]
|
48
|
-
|
49
|
-
|
50
|
+
|
51
|
+
|
50
52
|
==== Extending Ruby's Date class
|
51
53
|
Check which holidays occur in Iceland on January 1, 2008.
|
52
54
|
d = Date.civil(2008,7,1)
|
53
|
-
|
55
|
+
|
54
56
|
d.holidays(:is)
|
55
57
|
=> [{:name => 'Nýársdagur'}...]
|
56
|
-
|
58
|
+
|
57
59
|
Lookup Canada Day in different regions.
|
58
60
|
d = Date.civil(2008,7,1)
|
59
|
-
|
61
|
+
|
60
62
|
d.holiday?(:ca) # Canada
|
61
63
|
=> true
|
62
|
-
|
64
|
+
|
63
65
|
d.holiday?(:ca_bc) # British Columbia, Canada
|
64
66
|
=> true
|
65
|
-
|
67
|
+
|
66
68
|
d.holiday?(:fr) # France
|
67
69
|
=> false
|
68
|
-
|
70
|
+
|
71
|
+
=== How to contribute
|
72
|
+
To make changes to any of the definitions, edit the YAML files only.
|
73
|
+
|
74
|
+
Tests are also added at the end of the YAML files. Please add tests, it makes the pull requests go around.
|
75
|
+
|
76
|
+
After you're satisfied with the YAML file, edit the index.yaml file, run `rake defs:build_all` and `rake defs:manifest`, which will generate the ruby files that make up the actual code as well as the tests.
|
77
|
+
|
78
|
+
It is also very appreciated if documentation is attached to the pull request, a simple wikipedia post referencing the change would suffice.
|
79
|
+
|
80
|
+
Tests can be run using rake test, use rake -T to see all available tasks.
|
69
81
|
=== Credits and code
|
70
|
-
|
82
|
+
|
71
83
|
* Source: https://github.com/alexdunae/holidays
|
72
84
|
* Docs: http://rdoc.info/github/alexdunae/holidays/master/frames
|
73
85
|
* Contributors: https://github.com/alexdunae/holidays/contributors
|
74
86
|
* Build status: http://travis-ci.org/#!/alexdunae/holidays
|
75
|
-
|
87
|
+
|
76
88
|
Started by Alex Dunae (dunae.ca, e-mail 'code' at the same domain), 2007-12.
|
89
|
+
Maintained by Hana Wang (https://github.com/hahahana), 2013
|
77
90
|
|
78
91
|
On Twitter: @MrMrBug.
|
79
|
-
|
80
|
-
Made on Vancouver Island.
|
92
|
+
|
93
|
+
Made on Vancouver Island. Maintained in the way more beautiful Houston, TX.
|
data/data/ar.yaml
ADDED
@@ -0,0 +1,82 @@
|
|
1
|
+
# Argentinian holiday definitions for the Ruby Holiday gem.
|
2
|
+
#
|
3
|
+
# Updated: 2013-10-17.
|
4
|
+
#
|
5
|
+
# Sources:
|
6
|
+
# - http://en.wikipedia.org/wiki/Public_holidays_in_Argentina
|
7
|
+
#
|
8
|
+
---
|
9
|
+
months:
|
10
|
+
0:
|
11
|
+
- name: Jueves Santo
|
12
|
+
regions: [ar]
|
13
|
+
function: easter(year)-3
|
14
|
+
- name: Viernes Santo
|
15
|
+
regions: [ar]
|
16
|
+
function: easter(year)-2
|
17
|
+
1:
|
18
|
+
- name: Año Nuevo
|
19
|
+
regions: [ar]
|
20
|
+
mday: 1
|
21
|
+
3:
|
22
|
+
- name: Día Nacional de la Memoria por la Verdad y la Justicia
|
23
|
+
regions: [ar]
|
24
|
+
mday: 24
|
25
|
+
4:
|
26
|
+
- name: Día del Veterano y de los Caídos en la Guerra de Malvinas
|
27
|
+
regions: [ar]
|
28
|
+
mday: 2
|
29
|
+
5:
|
30
|
+
- name: Día del Trabajador
|
31
|
+
regions: [ar]
|
32
|
+
mday: 1
|
33
|
+
- name: Día de la Revolución de Mayo
|
34
|
+
regions: [ar]
|
35
|
+
mday: 25
|
36
|
+
6:
|
37
|
+
- name: Día de la Bandera
|
38
|
+
regions: [ar]
|
39
|
+
mday: 20
|
40
|
+
7:
|
41
|
+
- name: Día de la Independencia
|
42
|
+
regions: [ar]
|
43
|
+
mday: 9
|
44
|
+
8:
|
45
|
+
- name: Paso a la Inmortalidad del General José de San Martín
|
46
|
+
regions: [ar]
|
47
|
+
week: 3
|
48
|
+
wday: 1
|
49
|
+
10:
|
50
|
+
- name: Día del Respeto a la Diversidad Cultural
|
51
|
+
regions: [ar]
|
52
|
+
week: 2
|
53
|
+
wday: 1
|
54
|
+
11:
|
55
|
+
- name: Día de la Soberanía nacional
|
56
|
+
regions: [ar]
|
57
|
+
week: 4
|
58
|
+
wday: 1
|
59
|
+
12:
|
60
|
+
- name: Inmaculada Concepción de María
|
61
|
+
regions: [ar]
|
62
|
+
mday: 8
|
63
|
+
- name: Navidad
|
64
|
+
regions: [ar]
|
65
|
+
mday: 25
|
66
|
+
tests: |
|
67
|
+
{Date.civil(2013,1,1) => 'Año Nuevo',
|
68
|
+
Date.civil(2013,3,24) => 'Día Nacional de la Memoria por la Verdad y la Justicia',
|
69
|
+
Date.civil(2013,3,28) => 'Jueves Santo',
|
70
|
+
Date.civil(2013,3,29) => 'Viernes Santo',
|
71
|
+
Date.civil(2013,4,2) => 'Día del Veterano y de los Caídos en la Guerra de Malvinas',
|
72
|
+
Date.civil(2013,5,1) => 'Día del Trabajador',
|
73
|
+
Date.civil(2013,5,25) => 'Día de la Revolución de Mayo',
|
74
|
+
Date.civil(2013,6,20) => 'Día de la Bandera',
|
75
|
+
Date.civil(2013,7,9) => 'Día de la Independencia',
|
76
|
+
Date.civil(2013,8,19) => 'Paso a la Inmortalidad del General José de San Martín',
|
77
|
+
Date.civil(2013,10,14) => 'Día del Respeto a la Diversidad Cultural',
|
78
|
+
Date.civil(2013,11,25) => 'Día de la Soberanía nacional',
|
79
|
+
Date.civil(2013,12,8) => 'Inmaculada Concepción de María',
|
80
|
+
Date.civil(2013,12,25) => 'Navidad'}.each do |date, name|
|
81
|
+
assert_equal name, (Holidays.on(date, :ar, :informal)[0] || {})[:name]
|
82
|
+
end
|
data/data/au.yaml
CHANGED
@@ -14,6 +14,9 @@ months:
|
|
14
14
|
- name: Easter Saturday
|
15
15
|
regions: [au]
|
16
16
|
function: easter(year)-1
|
17
|
+
- name: Easter Sunday
|
18
|
+
regions: [au_nsw]
|
19
|
+
function: easter(year)
|
17
20
|
- name: Easter Monday
|
18
21
|
regions: [au]
|
19
22
|
function: easter(year)+1
|
@@ -47,8 +50,7 @@ months:
|
|
47
50
|
5:
|
48
51
|
- name: Labour Day
|
49
52
|
regions: [au_qld]
|
50
|
-
|
51
|
-
wday: 1
|
53
|
+
function: qld_labour_day_may(year)
|
52
54
|
- name: May Day
|
53
55
|
regions: [au_nt]
|
54
56
|
week: 1
|
@@ -59,7 +61,7 @@ months:
|
|
59
61
|
week: 1
|
60
62
|
wday: 1
|
61
63
|
- name: Queen's Birthday
|
62
|
-
regions: [au_act, au_nsw, au_sa, au_tas, au_nt,
|
64
|
+
regions: [au_act, au_nsw, au_sa, au_qld, au_tas, au_nt, au_vic]
|
63
65
|
week: 2
|
64
66
|
wday: 1
|
65
67
|
- name: Queensland Day
|
@@ -76,6 +78,12 @@ months:
|
|
76
78
|
regions: [au_act, au_nsw, au_sa]
|
77
79
|
week: 1
|
78
80
|
wday: 1
|
81
|
+
- name: Labour Day
|
82
|
+
regions: [au_qld]
|
83
|
+
function: qld_labour_day_october(year)
|
84
|
+
- name: Queen's Birthday
|
85
|
+
regions: [au_qld]
|
86
|
+
function: qld_queens_bday_october(year)
|
79
87
|
12:
|
80
88
|
- name: Christmas Day
|
81
89
|
regions: [au]
|
@@ -83,6 +91,25 @@ months:
|
|
83
91
|
- name: Boxing Day
|
84
92
|
regions: [au]
|
85
93
|
mday: 26
|
94
|
+
methods:
|
95
|
+
qld_queens_bday_october: |
|
96
|
+
# http://www.justice.qld.gov.au/fair-and-safe-work/industrial-relations/public-holidays/dates
|
97
|
+
# celebrated twice in 2012
|
98
|
+
def self.qld_queens_bday_october(year)
|
99
|
+
year == 2012 ? 1 : nil
|
100
|
+
end
|
101
|
+
qld_labour_day_may: |
|
102
|
+
# http://www.justice.qld.gov.au/fair-and-safe-work/industrial-relations/public-holidays/dates
|
103
|
+
# changed from may to october after 2012
|
104
|
+
def self.qld_labour_day_may(year)
|
105
|
+
year <= 2012 ? Date.calculate_mday(year, 5, 1, 1) : nil
|
106
|
+
end
|
107
|
+
qld_labour_day_october: |
|
108
|
+
# http://www.justice.qld.gov.au/fair-and-safe-work/industrial-relations/public-holidays/dates
|
109
|
+
# changed from may to october after 2012
|
110
|
+
def self.qld_labour_day_october(year)
|
111
|
+
year <= 2012 ? nil : Date.calculate_mday(year, 10, 1, 1)
|
112
|
+
end
|
86
113
|
tests: |
|
87
114
|
{Date.civil(2007,1,1) => 'New Year\'s Day',
|
88
115
|
Date.civil(2007,1,26) => 'Australia Day',
|
@@ -106,6 +133,15 @@ tests: |
|
|
106
133
|
assert_equal 'Labour Day', Date.civil(2007,3,12).holidays(:au_vic)[0][:name]
|
107
134
|
assert_equal 'Labour Day', Date.civil(2007,5,7).holidays(:au_qld)[0][:name]
|
108
135
|
|
136
|
+
assert_equal 'Easter Sunday', Date.civil(2007,4,8).holidays(:au_nsw)[0][:name]
|
137
|
+
|
109
138
|
assert_equal 'May Day', Date.civil(2007,5,7).holidays(:au_nt)[0][:name]
|
110
139
|
|
111
|
-
assert_equal 'Eight Hours Day', Date.civil(2007,3,12).holidays(:au_tas)[0][:name]
|
140
|
+
assert_equal 'Eight Hours Day', Date.civil(2007,3,12).holidays(:au_tas)[0][:name]
|
141
|
+
|
142
|
+
assert_equal 'Labour Day', Date.civil(2013,10,7).holidays(:au_qld)[0][:name]
|
143
|
+
assert_equal 'Labour Day', Date.civil(2012,5,7).holidays(:au_qld)[0][:name]
|
144
|
+
|
145
|
+
assert_equal "Queen's Birthday", Date.civil(2012,6,11).holidays(:au_qld)[0][:name]
|
146
|
+
assert_equal "Queen's Birthday", Date.civil(2012,10,1).holidays(:au_qld)[0][:name]
|
147
|
+
assert_equal "Queen's Birthday", Date.civil(2013,6,10).holidays(:au_qld)[0][:name]
|
data/data/be.yaml
ADDED
@@ -0,0 +1,65 @@
|
|
1
|
+
# Belgium holiday definitions for the Ruby Holiday gem.
|
2
|
+
#
|
3
|
+
# Updated: 2012-06-20.
|
4
|
+
# Sources:
|
5
|
+
# - http://en.wikipedia.org/wiki/Public_holidays_in_Belgium
|
6
|
+
---
|
7
|
+
months:
|
8
|
+
0:
|
9
|
+
- name: Easter
|
10
|
+
regions: [be]
|
11
|
+
function: easter(year)
|
12
|
+
- name: Easter Monday
|
13
|
+
regions: [be]
|
14
|
+
function: easter(year)+1
|
15
|
+
- name: Ascension
|
16
|
+
regions: [be]
|
17
|
+
function: easter(year)+39
|
18
|
+
- name: Pentecost
|
19
|
+
regions: [be]
|
20
|
+
function: easter(year)+49
|
21
|
+
- name: Pentecost Monday
|
22
|
+
regions: [be]
|
23
|
+
function: easter(year)+50
|
24
|
+
1:
|
25
|
+
- name: New Year's Day
|
26
|
+
regions: [be]
|
27
|
+
mday: 1
|
28
|
+
5:
|
29
|
+
- name: Labour Day
|
30
|
+
regions: [be]
|
31
|
+
mday: 1
|
32
|
+
7:
|
33
|
+
- name: National holiday
|
34
|
+
regions: [be]
|
35
|
+
mday: 21
|
36
|
+
8:
|
37
|
+
- name: Assumption of Mary
|
38
|
+
regions: [be]
|
39
|
+
mday: 15
|
40
|
+
11:
|
41
|
+
- name: All Saints
|
42
|
+
regions: [be]
|
43
|
+
mday: 1
|
44
|
+
- name: Armistice Day
|
45
|
+
regions: [be]
|
46
|
+
mday: 11
|
47
|
+
12:
|
48
|
+
- name: Christmas
|
49
|
+
regions: [be]
|
50
|
+
mday: 25
|
51
|
+
tests: |
|
52
|
+
{Date.civil(2007,1,1) => 'New Year\'s Day',
|
53
|
+
Date.civil(2007,4,8) => 'Easter',
|
54
|
+
Date.civil(2007,4,9) => 'Easter Monday',
|
55
|
+
Date.civil(2007,5,1) => 'Labour Day',
|
56
|
+
Date.civil(2007,5,17) => 'Ascension',
|
57
|
+
Date.civil(2007,5,27) => 'Pentecost',
|
58
|
+
Date.civil(2007,5,28) => 'Pentecost Monday',
|
59
|
+
Date.civil(2007,7,21) => 'National holiday',
|
60
|
+
Date.civil(2007,8,15) => 'Assumption of Mary',
|
61
|
+
Date.civil(2007,11,1) => 'All Saints',
|
62
|
+
Date.civil(2007,11,11) => 'Armistice Day',
|
63
|
+
Date.civil(2007,12,25) => 'Christmas'}.each do |date, name|
|
64
|
+
assert_equal name, (Holidays.on(date, :be, :informal)[0] || {})[:name]
|
65
|
+
end
|
data/data/br.yaml
CHANGED
@@ -5,9 +5,9 @@
|
|
5
5
|
# Sources:
|
6
6
|
# - http://pt.wikipedia.org/wiki/Feriados_no_Brasil
|
7
7
|
|
8
|
-
---
|
8
|
+
---
|
9
9
|
months:
|
10
|
-
0:
|
10
|
+
0:
|
11
11
|
- name: Carnaval # same as Shrove Tuesday
|
12
12
|
regions: [br]
|
13
13
|
function: easter(year)-47
|
@@ -18,10 +18,10 @@ months:
|
|
18
18
|
- name: Páscoa
|
19
19
|
regions: [br]
|
20
20
|
function: easter(year)
|
21
|
-
- name: Corpus
|
21
|
+
- name: Corpus Christi
|
22
22
|
regions: [br]
|
23
23
|
function: easter(year)+60
|
24
|
-
1:
|
24
|
+
1:
|
25
25
|
- name: Dia da Confraternização Universal
|
26
26
|
regions: [br]
|
27
27
|
mday: 1
|
@@ -29,7 +29,7 @@ months:
|
|
29
29
|
- name: Dia de Tiradentes
|
30
30
|
regions: [br]
|
31
31
|
mday: 21
|
32
|
-
5:
|
32
|
+
5:
|
33
33
|
- name: Dia do Trabalho
|
34
34
|
regions: [br]
|
35
35
|
mday: 1
|
@@ -37,11 +37,11 @@ months:
|
|
37
37
|
- name: Proclamação da Independência
|
38
38
|
regions: [br]
|
39
39
|
mday: 7
|
40
|
-
10:
|
40
|
+
10:
|
41
41
|
- name: Dia de Nossa Senhora Aparecida
|
42
42
|
regions: [br]
|
43
43
|
mday: 12
|
44
|
-
11:
|
44
|
+
11:
|
45
45
|
- name: Dia de Finados
|
46
46
|
regions: [br]
|
47
47
|
mday: 2
|
@@ -53,18 +53,18 @@ months:
|
|
53
53
|
regions: [br]
|
54
54
|
mday: 25
|
55
55
|
tests: |
|
56
|
-
{Date.civil(2008,1,1) => 'Dia da Confraternização Universal',
|
56
|
+
{Date.civil(2008,1,1) => 'Dia da Confraternização Universal',
|
57
57
|
Date.civil(2005,2,8) => 'Carnaval',
|
58
58
|
Date.civil(2006,2,28) => 'Carnaval',
|
59
59
|
Date.civil(2007,2,20) => 'Carnaval',
|
60
60
|
Date.civil(2008,2,5) => 'Carnaval',
|
61
|
-
Date.civil(2008,3,21) => 'Sexta-feira Santa',
|
61
|
+
Date.civil(2008,3,21) => 'Sexta-feira Santa',
|
62
62
|
Date.civil(2008,3,23) => 'Páscoa',
|
63
63
|
Date.civil(2008,4,21) => 'Dia de Tiradentes',
|
64
64
|
Date.civil(2008,5,1) => 'Dia do Trabalho',
|
65
|
-
Date.civil(2005,5,26) => 'Corpus
|
66
|
-
Date.civil(2007,6,7) => 'Corpus
|
67
|
-
Date.civil(2008,5,22) => 'Corpus
|
65
|
+
Date.civil(2005,5,26) => 'Corpus Christi',
|
66
|
+
Date.civil(2007,6,7) => 'Corpus Christi',
|
67
|
+
Date.civil(2008,5,22) => 'Corpus Christi',
|
68
68
|
Date.civil(2008,9,7) => 'Proclamação da Independência',
|
69
69
|
Date.civil(2008,10,12) => 'Dia de Nossa Senhora Aparecida',
|
70
70
|
Date.civil(2008,11,2) => 'Dia de Finados',
|