holidays 1.0.6 → 1.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/CHANGELOG.md +77 -0
- data/Gemfile +2 -6
- data/{README.rdoc → README.md} +46 -39
- data/Rakefile +62 -0
- data/data/au.yaml +11 -1
- data/data/cl.yaml +92 -0
- data/data/de.yaml +24 -0
- data/data/dk.yaml +3 -1
- data/data/ecb_target.yaml +42 -0
- data/data/es.yaml +44 -16
- data/data/fr.yaml +15 -10
- data/data/gb.yaml +14 -1
- data/data/index.yaml +7 -1
- data/data/lt.yaml +88 -0
- data/data/nl.yaml +10 -10
- data/data/se.yaml +26 -3
- data/data/sg.yaml +55 -0
- data/data/si.yaml +84 -0
- data/data/vi.yaml +29 -0
- data/holidays.gemspec +17 -187
- data/lib/holidays.rb +24 -14
- data/lib/holidays/MANIFEST +7 -0
- data/lib/holidays/au.rb +9 -9
- data/lib/holidays/cl.rb +43 -0
- data/lib/holidays/de.rb +1 -1
- data/lib/holidays/dk.rb +2 -2
- data/lib/holidays/ecb_target.rb +34 -0
- data/lib/holidays/es.rb +27 -27
- data/lib/holidays/europe.rb +72 -44
- data/lib/holidays/fr.rb +2 -2
- data/lib/holidays/gb.rb +3 -2
- data/lib/holidays/lt.rb +41 -0
- data/lib/holidays/nl.rb +1 -1
- data/lib/holidays/scandinavia.rb +6 -2
- data/lib/holidays/se.rb +7 -3
- data/lib/holidays/sg.rb +35 -0
- data/lib/holidays/si.rb +42 -0
- data/lib/holidays/version.rb +3 -0
- data/lib/holidays/vi.rb +32 -0
- data/test/defs/test_defs_au.rb +3 -0
- data/test/defs/test_defs_cl.rb +39 -0
- data/test/defs/test_defs_de.rb +24 -0
- data/test/defs/test_defs_dk.rb +1 -0
- data/test/defs/test_defs_ecb_target.rb +23 -0
- data/test/defs/test_defs_es.rb +7 -2
- data/test/defs/test_defs_europe.rb +84 -9
- data/test/defs/test_defs_fr.rb +7 -3
- data/test/defs/test_defs_gb.rb +7 -0
- data/test/defs/test_defs_lt.rb +42 -0
- data/test/defs/test_defs_nl.rb +3 -3
- data/test/defs/test_defs_scandinavia.rb +10 -2
- data/test/defs/test_defs_se.rb +9 -2
- data/test/defs/test_defs_sg.rb +20 -0
- data/test/defs/test_defs_si.rb +36 -0
- data/test/defs/test_defs_vi.rb +18 -0
- data/test/test_all_regions.rb +17 -9
- metadata +123 -105
- data/.travis.yml +0 -15
- data/CHANGELOG.rdoc +0 -57
- data/rakefile.rb +0 -107
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: dcfe36fdf6e053184b4e01f9fb8379b2bb3e485d
|
4
|
+
data.tar.gz: 35935e8eaf4daabcb40102eb025cb6c88dca4d47
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: c5b671008022b80ceaf7f385e7e44f95a5100f18fe401c3558777b1b988ef20e325033736b345037280e5b3206275074cea4ca8e7efe2dcbe0198fd399bc5902
|
7
|
+
data.tar.gz: 7522fa306023cb3d48808cfc3a40cf9e82c56df7e3f967fe10be7e54363c1160aa449a3621d16d56e1e18e5ff621fe7af79cc7ad6d8a1230f54753117a0ef4bc
|
data/CHANGELOG.md
ADDED
@@ -0,0 +1,77 @@
|
|
1
|
+
# Ruby Holidays Gem CHANGELOG
|
2
|
+
|
3
|
+
## 1.0.7
|
4
|
+
|
5
|
+
* Load parent region even when sub region is not explicitly defined (https://github.com/csage)
|
6
|
+
* Full support for http://en.wikipedia.org/wiki/ISO_3166-2:DE (https://github.com/rojoko)
|
7
|
+
* Added Lithuanian definitions (https://github.com/Brunas)
|
8
|
+
* Added Chilean definitions (https://github.com/marcelo-soto)g
|
9
|
+
* Added European Central Bank TARGET definitions (Toby Bryans, NASDAQ OMX NLX)
|
10
|
+
* FR: Make Pâques and Pentecôte informal holidays (https://github.com/wizcover)
|
11
|
+
* NL: Update for the new King (https://github.com/johankok)
|
12
|
+
* Added Slovenian definitions (https://github.com/bbalon)
|
13
|
+
|
14
|
+
## 1.0.6
|
15
|
+
|
16
|
+
* Added `Holidays.regions` method (https://github.com/sonnym)
|
17
|
+
* Added Slovakian definitions (https://github.com/mirelon)
|
18
|
+
* Added Venezuelan definitions (https://github.com/Chelo)
|
19
|
+
* Updated Canadian definitions (https://github.com/sdavies)
|
20
|
+
* Updated Argentinian definitions (https://github.com/popox)
|
21
|
+
* Updated Australian definitions (https://github.com/ghiculescu)
|
22
|
+
* Updated Portuguese definitions (https://github.com/MiPereira)
|
23
|
+
* Added Swiss definitions (https://github.com/samzurcher, https://github.com/jg)
|
24
|
+
* Added Romanian definitions (https://github.com/mtarnovan)
|
25
|
+
* Added Belgian definitions (https://github.com/jak78)
|
26
|
+
* Added Moroccan definitions (https://github.com/jak78)
|
27
|
+
* Fixes for New Year's and Boxing Day (https://github.com/iterion, https://github.com/andyw8)
|
28
|
+
* Fixes for Father's Day, Mother's Day and Armed Forces Day (https://github.com/eheikes)
|
29
|
+
* Typos (https://github.com/gregoriokusowski, https://github.com/popox)
|
30
|
+
* Added Croatian definitions (https://github.com/lecterror)
|
31
|
+
* Added US Federal Reserve holidays (https://github.com/willbarrett)
|
32
|
+
* Added NERC holidays (https://github.com/adamstrickland)
|
33
|
+
* Updated Irish holidays (https://github.com/xlcrs)
|
34
|
+
|
35
|
+
## 1.0.5
|
36
|
+
|
37
|
+
* Added `full_week?` method (https://github.com/dceddia)
|
38
|
+
* Added Portuguese definitions (https://github.com/pmor)
|
39
|
+
* Added Hungarian definitions (https://github.com/spap)
|
40
|
+
* Typos (https://github.com/DenisKnauf)
|
41
|
+
|
42
|
+
## 1.0.4
|
43
|
+
|
44
|
+
* Add Liechtenstein holiday defs (mercy vielmal Bernhard Furtmueller)
|
45
|
+
|
46
|
+
## 1.0.3
|
47
|
+
|
48
|
+
* Add Austrian holiday definitions (thanks to Vogel Siegfried)
|
49
|
+
|
50
|
+
## 1.0.2
|
51
|
+
|
52
|
+
* Add `orthodox_easter` method and Greek holiday definitions (thanks https://github.com/ddimitriadis)
|
53
|
+
|
54
|
+
## 1.0.0
|
55
|
+
|
56
|
+
* Support calculating mday from negative weeks other than -1 (thanks https://github.com/bjeanes)
|
57
|
+
* Use class method to check leap years and fixed bug in Date.calculate_mday (thanks https://github.com/dgrambow)
|
58
|
+
* Added Czech (thanks https://github.com/boblin), Brazilian (https://github.com/fabiokr), Norwegian (thanks to Peter Skeide) and Australia/Brisbane (https://github.com/bjeanes) definitions
|
59
|
+
* Cleaned up rake and gemspec
|
60
|
+
|
61
|
+
## 0.9.3
|
62
|
+
|
63
|
+
* Added New York Stock Exchange holidays (thank you Alan Larkin).
|
64
|
+
* Added UPS holidays (thank you Tim Anglade).
|
65
|
+
* Fixed rakefile to force lower case definition file names.
|
66
|
+
|
67
|
+
## 0.9.2
|
68
|
+
|
69
|
+
* Included rakefile in Gem (thank you James Herdman).
|
70
|
+
|
71
|
+
## 0.9.1
|
72
|
+
|
73
|
+
* au.yaml was being included incorrectly in US holiday definitions. Thanks to [Glenn Vanderburg](http://vanderburg.org/) for the fix.
|
74
|
+
|
75
|
+
## 0.9.0
|
76
|
+
|
77
|
+
* Initial release.
|
data/Gemfile
CHANGED
data/{README.rdoc → README.md}
RENAMED
@@ -1,92 +1,99 @@
|
|
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
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
14
|
|
15
|
-
|
15
|
+
## Time zones
|
16
16
|
|
17
17
|
Time zones are ignored. This library assumes that all dates are within the same time zone.
|
18
18
|
|
19
|
-
|
19
|
+
## Examples
|
20
20
|
|
21
21
|
For more information, see the notes at the top of the Holidays module.
|
22
22
|
|
23
|
-
|
23
|
+
### Using the Holidays class
|
24
|
+
|
24
25
|
Get all holidays on April 25, 2008 in Australia.
|
25
|
-
date = Date.civil(2008,4,25)
|
26
26
|
|
27
|
-
|
28
|
-
|
27
|
+
date = Date.civil(2008,4,25)
|
28
|
+
|
29
|
+
Holidays.on(date, :au)
|
30
|
+
=> [{:name => 'ANZAC Day',...}]
|
29
31
|
|
30
32
|
Get holidays that are observed on July 2, 2007 in British Columbia, Canada.
|
31
|
-
date = Date.civil(2007,7,2)
|
32
33
|
|
33
|
-
|
34
|
-
|
34
|
+
date = Date.civil(2007,7,2)
|
35
|
+
|
36
|
+
Holidays.on(date, :ca_bc, :observed)
|
37
|
+
=> [{:name => 'Canada Day',...}]
|
35
38
|
|
36
39
|
Get all holidays in July, 2008 in Canada and the US.
|
37
|
-
from = Date.civil(2008,7,1)
|
38
|
-
to = Date.civil(2008,7,31)
|
39
40
|
|
40
|
-
|
41
|
-
|
42
|
-
|
41
|
+
from = Date.civil(2008,7,1)
|
42
|
+
to = Date.civil(2008,7,31)
|
43
|
+
|
44
|
+
Holidays.between(from, to, :ca, :us)
|
45
|
+
=> [{:name => 'Canada Day',...}
|
46
|
+
{:name => 'Independence Day',...}]
|
43
47
|
|
44
48
|
Get informal holidays in February.
|
45
|
-
from = Date.civil(2008,2,1)
|
46
|
-
to = Date.civil(2008,2,15)
|
47
49
|
|
48
|
-
|
49
|
-
|
50
|
+
from = Date.civil(2008,2,1)
|
51
|
+
to = Date.civil(2008,2,15)
|
50
52
|
|
53
|
+
Holidays.between(from, to, :informal)
|
54
|
+
=> [{:name => 'Valentine\'s Day',...}]
|
55
|
+
|
56
|
+
### Extending Ruby's Date class
|
51
57
|
|
52
|
-
==== Extending Ruby's Date class
|
53
58
|
Check which holidays occur in Iceland on January 1, 2008.
|
54
|
-
d = Date.civil(2008,7,1)
|
55
59
|
|
56
|
-
|
57
|
-
|
60
|
+
d = Date.civil(2008,7,1)
|
61
|
+
|
62
|
+
d.holidays(:is)
|
63
|
+
=> [{:name => 'Nýársdagur'}...]
|
58
64
|
|
59
65
|
Lookup Canada Day in different regions.
|
60
|
-
d = Date.civil(2008,7,1)
|
61
66
|
|
62
|
-
|
63
|
-
|
67
|
+
d = Date.civil(2008,7,1)
|
68
|
+
|
69
|
+
d.holiday?(:ca) # Canada
|
70
|
+
=> true
|
71
|
+
|
72
|
+
d.holiday?(:ca_bc) # British Columbia, Canada
|
73
|
+
=> true
|
64
74
|
|
65
|
-
|
66
|
-
|
75
|
+
d.holiday?(:fr) # France
|
76
|
+
=> false
|
67
77
|
|
68
|
-
|
69
|
-
=> false
|
78
|
+
### How to contribute
|
70
79
|
|
71
|
-
=== How to contribute
|
72
80
|
To make changes to any of the definitions, edit the YAML files only.
|
73
81
|
|
74
82
|
Tests are also added at the end of the YAML files. Please add tests, it makes the pull requests go around.
|
75
83
|
|
76
|
-
After you're satisfied with the YAML file, edit the index.yaml file, run `rake
|
84
|
+
After you're satisfied with the YAML file, edit the index.yaml file, run `rake generate`, which will generate the Ruby files that make up the actual code as well as the tests. Then run `rake test`.
|
77
85
|
|
78
|
-
It is also very appreciated if documentation is attached to the pull request
|
86
|
+
It is also very appreciated if documentation is attached to the pull request. A simple Wikipedia or government link referencing the change would be perfect.
|
79
87
|
|
80
|
-
|
81
|
-
=== Credits and code
|
88
|
+
### Credits and code
|
82
89
|
|
83
90
|
* Source: https://github.com/alexdunae/holidays
|
84
91
|
* Docs: http://rdoc.info/github/alexdunae/holidays/master/frames
|
85
92
|
* Contributors: https://github.com/alexdunae/holidays/contributors
|
86
93
|
* Build status: http://travis-ci.org/#!/alexdunae/holidays
|
87
94
|
|
88
|
-
Started by Alex Dunae
|
89
|
-
Maintained by Hana Wang
|
95
|
+
Started by [Alex Dunae](http://dunae.ca) (e-mail 'code' at the same domain), 2007-12.
|
96
|
+
Maintained by [Hana Wang](https://github.com/hahahana), 2013
|
90
97
|
|
91
98
|
On Twitter: @MrMrBug.
|
92
99
|
|
data/Rakefile
ADDED
@@ -0,0 +1,62 @@
|
|
1
|
+
$:.unshift File.expand_path('../lib', __FILE__)
|
2
|
+
|
3
|
+
require 'bundler/gem_tasks'
|
4
|
+
require 'rake/testtask'
|
5
|
+
require 'yaml'
|
6
|
+
require 'fileutils'
|
7
|
+
require 'holidays'
|
8
|
+
require File.expand_path('data/build_defs')
|
9
|
+
|
10
|
+
Rake::TestTask.new(:test) do |t|
|
11
|
+
t.libs << 'test'
|
12
|
+
t.test_files = FileList['test/**/test*.rb']
|
13
|
+
end
|
14
|
+
|
15
|
+
task :default => :test
|
16
|
+
|
17
|
+
namespace :generate do
|
18
|
+
DATA_PATH = 'data'
|
19
|
+
|
20
|
+
desc 'Generate the holiday definition files'
|
21
|
+
task :definitions do
|
22
|
+
# load the index
|
23
|
+
def_index = YAML.load_file("#{DATA_PATH}/index.yaml")
|
24
|
+
|
25
|
+
# create a dir for the generated tests
|
26
|
+
FileUtils.mkdir_p('test/defs')
|
27
|
+
|
28
|
+
def_index['defs'].each do |region, files|
|
29
|
+
puts "Building #{region} definition module:"
|
30
|
+
files = files.collect { |f| "#{DATA_PATH}/#{f}" }.uniq
|
31
|
+
|
32
|
+
module_src, test_src = parse_holiday_defs(region, files)
|
33
|
+
File.open("lib/holidays/#{region.downcase.to_s}.rb","w") do |file|
|
34
|
+
file.puts module_src
|
35
|
+
end
|
36
|
+
unless test_src.empty?
|
37
|
+
File.open("test/defs/test_defs_#{region.downcase.to_s}.rb","w") do |file|
|
38
|
+
file.puts test_src
|
39
|
+
end
|
40
|
+
end
|
41
|
+
puts "Done.\n\n"
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
desc 'Build the definition manifest'
|
46
|
+
task :manifest do
|
47
|
+
File.open("lib/holidays/MANIFEST","w") do |file|
|
48
|
+
file.puts <<-EOH
|
49
|
+
==== Regional definitions
|
50
|
+
The following definition files are included in this installation:
|
51
|
+
|
52
|
+
EOH
|
53
|
+
FileList.new('lib/holidays/*.rb').exclude(/version/).each do |str|
|
54
|
+
file.puts('* ' + str.gsub(/^lib\/|\.rb$/, ''))
|
55
|
+
end
|
56
|
+
end
|
57
|
+
puts "Updated manifest file."
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
task :generate => ['generate:definitions', 'generate:manifest']
|
62
|
+
|
data/data/au.yaml
CHANGED
@@ -12,7 +12,7 @@ months:
|
|
12
12
|
regions: [au]
|
13
13
|
function: easter(year)-2
|
14
14
|
- name: Easter Saturday
|
15
|
-
regions: [
|
15
|
+
regions: [au_nsw, au_vic, au_qld, au_nt, au_act, au_sa, au_qld_brisbane]
|
16
16
|
function: easter(year)-1
|
17
17
|
- name: Easter Sunday
|
18
18
|
regions: [au_nsw]
|
@@ -27,9 +27,11 @@ months:
|
|
27
27
|
- name: New Year's Day
|
28
28
|
regions: [au]
|
29
29
|
mday: 1
|
30
|
+
observed: to_monday_if_weekend
|
30
31
|
- name: Australia Day
|
31
32
|
regions: [au]
|
32
33
|
mday: 26
|
34
|
+
observed: to_monday_if_weekend
|
33
35
|
3:
|
34
36
|
- name: Labour Day
|
35
37
|
regions: [au_wa]
|
@@ -47,6 +49,7 @@ months:
|
|
47
49
|
- name: ANZAC Day
|
48
50
|
regions: [au]
|
49
51
|
mday: 25
|
52
|
+
observed: to_monday_if_weekend
|
50
53
|
5:
|
51
54
|
- name: Labour Day
|
52
55
|
regions: [au_qld]
|
@@ -81,16 +84,20 @@ months:
|
|
81
84
|
- name: Labour Day
|
82
85
|
regions: [au_qld]
|
83
86
|
function: qld_labour_day_october(year)
|
87
|
+
observed: to_monday_if_weekend
|
84
88
|
- name: Queen's Birthday
|
85
89
|
regions: [au_qld]
|
86
90
|
function: qld_queens_bday_october(year)
|
91
|
+
observed: to_monday_if_weekend
|
87
92
|
12:
|
88
93
|
- name: Christmas Day
|
89
94
|
regions: [au]
|
90
95
|
mday: 25
|
96
|
+
observed: to_monday_if_weekend
|
91
97
|
- name: Boxing Day
|
92
98
|
regions: [au]
|
93
99
|
mday: 26
|
100
|
+
observed: to_weekday_if_boxing_weekend
|
94
101
|
methods:
|
95
102
|
qld_queens_bday_october: |
|
96
103
|
# http://www.justice.qld.gov.au/fair-and-safe-work/industrial-relations/public-holidays/dates
|
@@ -145,3 +152,6 @@ tests: |
|
|
145
152
|
assert_equal "Queen's Birthday", Date.civil(2012,6,11).holidays(:au_qld)[0][:name]
|
146
153
|
assert_equal "Queen's Birthday", Date.civil(2012,10,1).holidays(:au_qld)[0][:name]
|
147
154
|
assert_equal "Queen's Birthday", Date.civil(2013,6,10).holidays(:au_qld)[0][:name]
|
155
|
+
|
156
|
+
assert_equal 'Australia Day', Date.civil(2014,1,26).holidays(:au_qld)[0][:name]
|
157
|
+
assert_equal 'Australia Day', Date.civil(2014,1,27).holidays(:au_qld, :observed)[0][:name]
|
data/data/cl.yaml
ADDED
@@ -0,0 +1,92 @@
|
|
1
|
+
# Chilean holiday definitions for the Ruby Holiday gem.
|
2
|
+
#
|
3
|
+
# Updated: 2014-10-08
|
4
|
+
#
|
5
|
+
# Sources:
|
6
|
+
# - http://www.feriados.cl
|
7
|
+
#
|
8
|
+
---
|
9
|
+
months:
|
10
|
+
0:
|
11
|
+
- name: Viernes Santo
|
12
|
+
regions: [cl]
|
13
|
+
function: easter(year)-2
|
14
|
+
- name: Sábado Santo
|
15
|
+
regions: [cl]
|
16
|
+
function: easter(year)-1
|
17
|
+
1:
|
18
|
+
- name: Año Nuevo
|
19
|
+
regions: [cl]
|
20
|
+
mday: 1
|
21
|
+
5:
|
22
|
+
- name: Día del Trabajo
|
23
|
+
regions: [cl]
|
24
|
+
mday: 1
|
25
|
+
- name: Día de las Glorias Navales
|
26
|
+
regions: [cl]
|
27
|
+
mday: 21
|
28
|
+
6:
|
29
|
+
- name: San Pedro y San Pablo
|
30
|
+
regions: [cl]
|
31
|
+
mday: 29
|
32
|
+
7:
|
33
|
+
- name: Día de la Virgen del Carmen
|
34
|
+
regions: [cl]
|
35
|
+
mday: 16
|
36
|
+
8:
|
37
|
+
- name: Asunción de la Virgen
|
38
|
+
regions: [cl]
|
39
|
+
mday: 15
|
40
|
+
9:
|
41
|
+
- name: Independencia Nacional
|
42
|
+
regions: [cl]
|
43
|
+
mday: 18
|
44
|
+
- name: Día de las Glorias del Ejército
|
45
|
+
regions: [cl]
|
46
|
+
mday: 19
|
47
|
+
10:
|
48
|
+
- name: Encuentro de Dos Mundos
|
49
|
+
regions: [cl]
|
50
|
+
mday: 12
|
51
|
+
- name: Día de las Iglesias Evangélicas y Protestantes
|
52
|
+
regions: [cl]
|
53
|
+
mday: 31
|
54
|
+
11:
|
55
|
+
- name: Día de Todos los Santos
|
56
|
+
regions: [cl]
|
57
|
+
mday: 1
|
58
|
+
12:
|
59
|
+
- name: Inmaculada Concepción de María
|
60
|
+
regions: [cl]
|
61
|
+
mday: 8
|
62
|
+
- name: Navidad
|
63
|
+
regions: [cl]
|
64
|
+
mday: 25
|
65
|
+
tests: |
|
66
|
+
{Date.civil(2014,1,1) => 'Año Nuevo',
|
67
|
+
Date.civil(2011,4,22) => 'Viernes Santo',
|
68
|
+
Date.civil(2011,4,23) => 'Sábado Santo',
|
69
|
+
Date.civil(2012,4,6) => 'Viernes Santo',
|
70
|
+
Date.civil(2012,4,7) => 'Sábado Santo',
|
71
|
+
Date.civil(2013,3,29) => 'Viernes Santo',
|
72
|
+
Date.civil(2013,3,30) => 'Sábado Santo',
|
73
|
+
Date.civil(2014,4,18) => 'Viernes Santo',
|
74
|
+
Date.civil(2014,4,19) => 'Sábado Santo',
|
75
|
+
Date.civil(2015,4,3) => 'Viernes Santo',
|
76
|
+
Date.civil(2015,4,4) => 'Sábado Santo',
|
77
|
+
Date.civil(2016,3,25) => 'Viernes Santo',
|
78
|
+
Date.civil(2016,3,26) => 'Sábado Santo',
|
79
|
+
Date.civil(2014,5,1) => 'Día del Trabajo',
|
80
|
+
Date.civil(2014,5,21) => "Día de las Glorias Navales",
|
81
|
+
Date.civil(2014,6,29) => "San Pedro y San Pablo",
|
82
|
+
Date.civil(2014,7,16) => "Día de la Virgen del Carmen",
|
83
|
+
Date.civil(2014,8,15) => "Asunción de la Virgen",
|
84
|
+
Date.civil(2014,9,18) => "Independencia Nacional",
|
85
|
+
Date.civil(2014,9,19) => "Día de las Glorias del Ejército",
|
86
|
+
Date.civil(2014,10,12) => "Encuentro de Dos Mundos",
|
87
|
+
Date.civil(2014,10,31) => "Día de las Iglesias Evangélicas y Protestantes",
|
88
|
+
Date.civil(2014,11,1) => "Día de Todos los Santos",
|
89
|
+
Date.civil(2014,12,8) => 'Inmaculada Concepción de María',
|
90
|
+
Date.civil(2014,12,25) => 'Navidad'}.each do |date, name|
|
91
|
+
assert_equal name, (Holidays.on(date, :cl, :informal)[0] || {})[:name]
|
92
|
+
end
|
data/data/de.yaml
CHANGED
@@ -104,6 +104,30 @@ tests: |
|
|
104
104
|
assert_equal 'Allerheiligen', Date.civil(2009,11,1).holidays(r)[0][:name]
|
105
105
|
end
|
106
106
|
|
107
|
+
[:de_be, :de_hb, :de_hh, :de_ni, :de_sh].each do |r|
|
108
|
+
assert_equal 'Tag der Deutschen Einheit', Date.civil(2009,10,3).holidays(r)[0][:name]
|
109
|
+
end
|
110
|
+
|
111
|
+
[:de_be, :de_hb, :de_hh, :de_ni, :de_sh].each do |r|
|
112
|
+
assert !Date.civil(2009,1,6).holiday?(r), "Heilige Drei Könige is not a holiday in #{r}"
|
113
|
+
end
|
114
|
+
|
115
|
+
[:de_be, :de_hb, :de_hh, :de_ni, :de_sh].each do |r|
|
116
|
+
assert !Date.civil(2009,6,11).holiday?(r), "Fronleichnam is not a holiday in #{r}"
|
117
|
+
end
|
118
|
+
|
119
|
+
[:de_be, :de_hb, :de_hh, :de_ni, :de_sh].each do |r|
|
120
|
+
assert !Date.civil(2009,8,15).holiday?(r), "Mariä Himmelfahrt is not a holiday in #{r}"
|
121
|
+
end
|
122
|
+
|
123
|
+
[:de_be, :de_hb, :de_hh, :de_ni, :de_sh].each do |r|
|
124
|
+
assert !Date.civil(2009,10,31).holiday?(r), 'Reformationstag is not a holiday in #{r}'
|
125
|
+
end
|
126
|
+
|
127
|
+
[:de_be, :de_hb, :de_hh, :de_ni, :de_sh].each do |r|
|
128
|
+
assert !Date.civil(2009,11,1).holiday?(r), "Allerheiligen is not a holiday in #{r}"
|
129
|
+
end
|
130
|
+
|
107
131
|
assert !Date.civil(2010,5,8).holiday?(:de), '2010-05-08 is not a holiday in Germany'
|
108
132
|
|
109
133
|
# Repentance Day
|