holidays 2.2.0 → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +11 -0
- data/README.md +22 -8
- data/Rakefile +26 -8
- data/bin/console +7 -0
- data/bin/setup +5 -0
- data/{data → definitions}/SYNTAX.rdoc +0 -0
- data/{data → definitions}/ar.yaml +0 -0
- data/{data → definitions}/at.yaml +1 -1
- data/{data → definitions}/au.yaml +80 -51
- data/{data → definitions}/be.yaml +0 -0
- data/{data → definitions}/br.yaml +0 -0
- data/{data → definitions}/ca.yaml +0 -0
- data/{data → definitions}/ch.yaml +0 -0
- data/{data → definitions}/cl.yaml +0 -0
- data/{data → definitions}/cr.yaml +0 -0
- data/{data → definitions}/cz.yaml +0 -0
- data/{data → definitions}/de.yaml +25 -34
- data/{data → definitions}/dk.yaml +0 -0
- data/{data → definitions}/ecb_target.yaml +2 -2
- data/{data → definitions}/el.yaml +0 -0
- data/{data → definitions}/es.yaml +37 -26
- data/{data → definitions}/federal_reserve.yaml +0 -0
- data/{data → definitions}/fedex.yaml +9 -3
- data/{data → definitions}/fi.yaml +0 -0
- data/{data → definitions}/fr.yaml +0 -0
- data/{data → definitions}/gb.yaml +19 -19
- data/{data → definitions}/hr.yaml +0 -0
- data/{data → definitions}/hu.yaml +1 -1
- data/{data → definitions}/ie.yaml +0 -0
- data/{data → definitions}/index.yaml +0 -0
- data/{data → definitions}/is.yaml +0 -0
- data/{data → definitions}/it.yaml +0 -0
- data/{data → definitions}/jp.yaml +3 -3
- data/{data → definitions}/li.yaml +3 -3
- data/{data → definitions}/lt.yaml +0 -0
- data/{data → definitions}/ma.yaml +0 -0
- data/{data → definitions}/mx.yaml +0 -0
- data/{data → definitions}/nerc.yaml +0 -0
- data/{data → definitions}/nl.yaml +0 -0
- data/{data → definitions}/no.yaml +0 -0
- data/{data → definitions}/north_america_informal.yaml +0 -0
- data/{data → definitions}/nyse.yaml +0 -0
- data/{data → definitions}/nz.yaml +21 -10
- data/{data → definitions}/ph.yaml +0 -0
- data/{data → definitions}/pl.yaml +0 -0
- data/{data → definitions}/pt.yaml +0 -0
- data/{data → definitions}/ro.yaml +1 -2
- data/{data → definitions}/se.yaml +0 -0
- data/{data → definitions}/sg.yaml +0 -0
- data/{data → definitions}/si.yaml +6 -6
- data/{data → definitions}/sk.yaml +0 -0
- data/{data → definitions}/united_nations.yaml +0 -0
- data/{data → definitions}/ups.yaml +17 -11
- data/{data → definitions}/us.yaml +20 -15
- data/{data → definitions}/ve.yaml +0 -0
- data/{data → definitions}/vi.yaml +0 -0
- data/{data → definitions}/za.yaml +0 -0
- data/holidays.gemspec +2 -1
- data/lib/generated_definitions/MANIFEST +56 -0
- data/lib/generated_definitions/REGIONS.rb +4 -0
- data/lib/{holidays → generated_definitions}/ar.rb +2 -2
- data/lib/{holidays → generated_definitions}/at.rb +2 -2
- data/lib/{holidays → generated_definitions}/au.rb +19 -10
- data/lib/{holidays → generated_definitions}/be.rb +2 -2
- data/lib/{holidays → generated_definitions}/br.rb +2 -2
- data/lib/{holidays → generated_definitions}/ca.rb +2 -2
- data/lib/{holidays → generated_definitions}/ch.rb +2 -2
- data/lib/{holidays → generated_definitions}/cl.rb +2 -2
- data/lib/{holidays → generated_definitions}/cr.rb +2 -2
- data/lib/{holidays → generated_definitions}/cz.rb +2 -2
- data/lib/{holidays → generated_definitions}/de.rb +5 -4
- data/lib/{holidays → generated_definitions}/dk.rb +2 -2
- data/lib/{holidays → generated_definitions}/ecb_target.rb +2 -2
- data/lib/{holidays → generated_definitions}/el.rb +2 -2
- data/lib/{holidays → generated_definitions}/es.rb +6 -6
- data/lib/{holidays → generated_definitions}/europe.rb +7 -6
- data/lib/{holidays → generated_definitions}/fed_ex.rb +8 -3
- data/lib/{holidays → generated_definitions}/federal_reserve.rb +2 -2
- data/lib/{holidays → generated_definitions}/fi.rb +2 -2
- data/lib/{holidays → generated_definitions}/fr.rb +2 -2
- data/lib/{holidays → generated_definitions}/gb.rb +2 -2
- data/lib/{holidays → generated_definitions}/hr.rb +2 -2
- data/lib/{holidays → generated_definitions}/hu.rb +2 -2
- data/lib/{holidays → generated_definitions}/ie.rb +2 -2
- data/lib/{holidays → generated_definitions}/is.rb +2 -2
- data/lib/{holidays → generated_definitions}/it.rb +2 -2
- data/lib/{holidays → generated_definitions}/jp.rb +5 -5
- data/lib/{holidays → generated_definitions}/li.rb +2 -2
- data/lib/{holidays → generated_definitions}/lt.rb +2 -2
- data/lib/{holidays → generated_definitions}/ma.rb +2 -2
- data/lib/{holidays → generated_definitions}/mx.rb +2 -2
- data/lib/{holidays → generated_definitions}/nerc.rb +2 -2
- data/lib/{holidays → generated_definitions}/nl.rb +2 -2
- data/lib/{holidays → generated_definitions}/no.rb +2 -2
- data/lib/{holidays → generated_definitions}/north_america.rb +8 -3
- data/lib/{holidays → generated_definitions}/nyse.rb +2 -2
- data/lib/{holidays → generated_definitions}/nz.rb +5 -5
- data/lib/{holidays → generated_definitions}/ph.rb +2 -2
- data/lib/{holidays → generated_definitions}/pl.rb +2 -2
- data/lib/{holidays → generated_definitions}/pt.rb +2 -2
- data/lib/{holidays → generated_definitions}/ro.rb +2 -2
- data/lib/{holidays → generated_definitions}/scandinavia.rb +2 -2
- data/lib/{holidays → generated_definitions}/se.rb +2 -2
- data/lib/{holidays → generated_definitions}/sg.rb +2 -2
- data/lib/{holidays → generated_definitions}/si.rb +2 -2
- data/lib/{holidays → generated_definitions}/sk.rb +2 -2
- data/lib/{holidays → generated_definitions}/united_nations.rb +2 -2
- data/lib/{holidays → generated_definitions}/ups.rb +8 -3
- data/lib/{holidays → generated_definitions}/us.rb +8 -3
- data/lib/{holidays → generated_definitions}/ve.rb +2 -2
- data/lib/{holidays → generated_definitions}/vi.rb +2 -2
- data/lib/{holidays → generated_definitions}/za.rb +2 -2
- data/lib/holidays.rb +120 -665
- data/lib/holidays/core_extensions/date.rb +39 -0
- data/lib/holidays/date_calculator/day_of_month.rb +68 -0
- data/lib/holidays/date_calculator/easter.rb +58 -0
- data/lib/holidays/date_calculator/weekend_modifier.rb +49 -0
- data/lib/holidays/date_calculator_factory.rb +21 -0
- data/lib/holidays/definition/context/generator.rb +216 -0
- data/lib/holidays/definition/context/merger.rb +26 -0
- data/lib/holidays/definition/repository/cache.rb +33 -0
- data/lib/holidays/definition/repository/holidays_by_month.rb +49 -0
- data/lib/holidays/definition/repository/proc_cache.rb +36 -0
- data/lib/holidays/definition/repository/regions.rb +36 -0
- data/lib/holidays/definition/validator/region.rb +45 -0
- data/lib/holidays/definition_factory.rb +50 -0
- data/lib/holidays/option/context/parse_options.rb +96 -0
- data/lib/holidays/option_factory.rb +14 -0
- data/lib/holidays/use_case/context/between.rb +105 -0
- data/lib/holidays/use_case/context/dates_driver_builder.rb +64 -0
- data/lib/holidays/use_case_factory.rb +20 -0
- data/lib/holidays/version.rb +1 -1
- data/test/defs/test_defs_ar.rb +1 -1
- data/test/defs/test_defs_at.rb +2 -2
- data/test/defs/test_defs_au.rb +61 -43
- data/test/defs/test_defs_be.rb +1 -1
- data/test/defs/test_defs_br.rb +1 -1
- data/test/defs/test_defs_ca.rb +1 -1
- data/test/defs/test_defs_ch.rb +1 -1
- data/test/defs/test_defs_cl.rb +1 -1
- data/test/defs/test_defs_cr.rb +1 -1
- data/test/defs/test_defs_cz.rb +1 -1
- data/test/defs/test_defs_de.rb +18 -30
- data/test/defs/test_defs_dk.rb +1 -1
- data/test/defs/test_defs_ecb_target.rb +3 -3
- data/test/defs/test_defs_el.rb +1 -1
- data/test/defs/test_defs_es.rb +36 -25
- data/test/defs/test_defs_europe.rb +82 -84
- data/test/defs/test_defs_fed_ex.rb +4 -1
- data/test/defs/test_defs_federal_reserve.rb +1 -1
- data/test/defs/test_defs_fi.rb +1 -1
- data/test/defs/test_defs_fr.rb +1 -1
- data/test/defs/test_defs_gb.rb +20 -20
- data/test/defs/test_defs_hr.rb +1 -1
- data/test/defs/test_defs_hu.rb +2 -2
- data/test/defs/test_defs_ie.rb +1 -1
- data/test/defs/test_defs_is.rb +1 -1
- data/test/defs/test_defs_it.rb +1 -1
- data/test/defs/test_defs_jp.rb +1 -1
- data/test/defs/test_defs_li.rb +4 -4
- data/test/defs/test_defs_lt.rb +1 -1
- data/test/defs/test_defs_ma.rb +1 -1
- data/test/defs/test_defs_mx.rb +1 -1
- data/test/defs/test_defs_nerc.rb +1 -1
- data/test/defs/test_defs_nl.rb +1 -1
- data/test/defs/test_defs_no.rb +1 -1
- data/test/defs/test_defs_north_america.rb +5 -3
- data/test/defs/test_defs_nyse.rb +1 -1
- data/test/defs/test_defs_nz.rb +19 -9
- data/test/defs/test_defs_ph.rb +1 -1
- data/test/defs/test_defs_pl.rb +1 -1
- data/test/defs/test_defs_pt.rb +1 -1
- data/test/defs/test_defs_ro.rb +2 -3
- data/test/defs/test_defs_scandinavia.rb +1 -1
- data/test/defs/test_defs_se.rb +1 -1
- data/test/defs/test_defs_sg.rb +1 -1
- data/test/defs/test_defs_si.rb +7 -7
- data/test/defs/test_defs_sk.rb +1 -1
- data/test/defs/test_defs_united_nations.rb +1 -1
- data/test/defs/test_defs_ups.rb +5 -2
- data/test/defs/test_defs_us.rb +5 -3
- data/test/defs/test_defs_ve.rb +1 -1
- data/test/defs/test_defs_vi.rb +1 -1
- data/test/defs/test_defs_za.rb +1 -1
- data/test/{test_date.rb → holidays/core_extensions/test_date.rb} +8 -2
- data/test/holidays/date_calculator/test_day_of_month.rb +27 -0
- data/test/holidays/date_calculator/test_easter.rb +29 -0
- data/test/holidays/date_calculator/test_weekend_modifier.rb +33 -0
- data/test/holidays/definition/context/test_generator.rb +84 -0
- data/test/holidays/definition/context/test_merger.rb +22 -0
- data/test/holidays/definition/repository/test_cache.rb +82 -0
- data/test/holidays/definition/repository/test_holidays_by_month.rb +187 -0
- data/test/holidays/definition/repository/test_proc_cache.rb +29 -0
- data/test/holidays/definition/repository/test_regions.rb +86 -0
- data/test/holidays/definition/validator/test_region.rb +50 -0
- data/test/holidays/option/context/test_parse_options.rb +69 -0
- data/test/holidays/test_date_calculator_factory.rb +21 -0
- data/test/holidays/test_definition_factory.rb +34 -0
- data/test/holidays/test_option_factory.rb +9 -0
- data/test/holidays/test_use_case_factory.rb +13 -0
- data/test/holidays/use_case/context/test_between.rb +75 -0
- data/test/holidays/use_case/context/test_dates_driver_builder.rb +91 -0
- data/test/test_all_regions.rb +14 -3
- data/test/test_helper.rb +2 -1
- data/test/test_holidays.rb +19 -24
- data/test/test_holidays_between.rb +85 -0
- data/test/test_multiple_regions.rb +2 -2
- data/test/test_parse_definitions.rb +10 -4
- metadata +181 -111
- data/.coveralls.yml +0 -1
- data/lib/holidays/MANIFEST +0 -55
@@ -2,9 +2,9 @@
|
|
2
2
|
#
|
3
3
|
# Updated: 2008-11-24.
|
4
4
|
# Source: http://en.wikipedia.org/wiki/Public_holidays_of_the_United_States
|
5
|
-
---
|
5
|
+
---
|
6
6
|
months:
|
7
|
-
0:
|
7
|
+
0:
|
8
8
|
- name: Good Friday
|
9
9
|
regions: [us]
|
10
10
|
function: easter(year)-2
|
@@ -13,7 +13,7 @@ months:
|
|
13
13
|
regions: [us]
|
14
14
|
function: easter(year)
|
15
15
|
type: informal
|
16
|
-
1:
|
16
|
+
1:
|
17
17
|
- name: New Year's Day
|
18
18
|
regions: [us]
|
19
19
|
mday: 1
|
@@ -25,36 +25,36 @@ months:
|
|
25
25
|
- name: Inauguration Day
|
26
26
|
function: us_inauguration_day(year)
|
27
27
|
regions: [us_dc]
|
28
|
-
2:
|
28
|
+
2:
|
29
29
|
- name: Presidents' Day
|
30
30
|
week: 3
|
31
31
|
regions: [us]
|
32
32
|
wday: 1
|
33
|
-
3:
|
33
|
+
3:
|
34
34
|
- name: 'Cesar Chavez Day'
|
35
35
|
regions: [us_ca]
|
36
36
|
mday: 31
|
37
|
-
5:
|
37
|
+
5:
|
38
38
|
- name: Memorial Day
|
39
39
|
week: -1
|
40
40
|
regions: [us]
|
41
41
|
wday: 1
|
42
|
-
7:
|
42
|
+
7:
|
43
43
|
- name: Independence Day
|
44
44
|
regions: [us]
|
45
45
|
mday: 4
|
46
46
|
observed: to_weekday_if_weekend
|
47
|
-
9:
|
47
|
+
9:
|
48
48
|
- name: Labor Day
|
49
49
|
week: 1
|
50
50
|
regions: [us]
|
51
51
|
wday: 1
|
52
|
-
10:
|
52
|
+
10:
|
53
53
|
- name: Columbus Day
|
54
54
|
week: 2
|
55
55
|
regions: [us]
|
56
56
|
wday: 1
|
57
|
-
11:
|
57
|
+
11:
|
58
58
|
- name: Veterans Day
|
59
59
|
regions: [us]
|
60
60
|
mday: 11
|
@@ -64,10 +64,9 @@ months:
|
|
64
64
|
regions: [us]
|
65
65
|
wday: 4
|
66
66
|
- name: Day after Thanksgiving
|
67
|
-
|
67
|
+
function: day_after_thanksgiving(year)
|
68
68
|
regions: [us_ca]
|
69
|
-
|
70
|
-
12:
|
69
|
+
12:
|
71
70
|
- name: Christmas Day
|
72
71
|
regions: [us]
|
73
72
|
mday: 25
|
@@ -78,8 +77,12 @@ methods:
|
|
78
77
|
def self.us_inauguration_day(year)
|
79
78
|
year % 4 == 1 ? 20 : nil
|
80
79
|
end
|
80
|
+
day_after_thanksgiving: |
|
81
|
+
def self.day_after_thanksgiving(year)
|
82
|
+
Date.calculate_mday(year, 11, 4, 4) + 1
|
83
|
+
end
|
81
84
|
tests: |
|
82
|
-
{Date.civil(2008,1,1) => 'New Year\'s Day',
|
85
|
+
{Date.civil(2008,1,1) => 'New Year\'s Day',
|
83
86
|
Date.civil(2008,1,21) => 'Martin Luther King, Jr. Day',
|
84
87
|
Date.civil(2008,2,18) => 'Presidents\' Day',
|
85
88
|
Date.civil(2008,5,26) => 'Memorial Day',
|
@@ -88,10 +91,12 @@ tests: |
|
|
88
91
|
Date.civil(2008,10,13) => 'Columbus Day',
|
89
92
|
Date.civil(2008,11,11) => 'Veterans Day',
|
90
93
|
Date.civil(2008,11,27) => 'Thanksgiving',
|
94
|
+
Date.civil(2013,11,28) => 'Thanksgiving',
|
91
95
|
Date.civil(2008,12,25) => 'Christmas Day'}.each do |date, name|
|
92
96
|
assert_equal name, (Holidays.on(date, :us)[0] || {})[:name]
|
93
97
|
end
|
94
98
|
{Date.civil(2008, 3, 31) => 'Cesar Chavez Day',
|
95
|
-
Date.civil(2008, 11, 28) => 'Day after Thanksgiving'
|
99
|
+
Date.civil(2008, 11, 28) => 'Day after Thanksgiving',
|
100
|
+
Date.civil(2013, 11, 29) => 'Day after Thanksgiving'}.each do |date, name|
|
96
101
|
assert_equal name, (Holidays.on(date, :us, :us_ca)[0] || {})[:name]
|
97
102
|
end
|
File without changes
|
File without changes
|
File without changes
|
data/holidays.gemspec
CHANGED
@@ -12,7 +12,7 @@ Gem::Specification.new do |gem|
|
|
12
12
|
gem.homepage = 'https://github.com/alexdunae/holidays'
|
13
13
|
gem.description = %q(A collection of Ruby methods to deal with statutory and other holidays. You deserve a holiday!)
|
14
14
|
gem.summary = %q(A collection of Ruby methods to deal with statutory and other holidays.)
|
15
|
-
gem.files = `git ls-files`.split("\n") - ['.gitignore', '.travis.yml']
|
15
|
+
gem.files = `git ls-files`.split("\n") - ['.gitignore', '.travis.yml', '.coveralls.yml']
|
16
16
|
gem.test_files = gem.files.grep(/^test/)
|
17
17
|
gem.require_paths = ['lib']
|
18
18
|
gem.licenses = ['MIT']
|
@@ -20,4 +20,5 @@ Gem::Specification.new do |gem|
|
|
20
20
|
gem.add_development_dependency 'rake'
|
21
21
|
gem.add_development_dependency 'coveralls'
|
22
22
|
gem.add_development_dependency 'test-unit'
|
23
|
+
gem.add_development_dependency 'mocha', '~>1.0'
|
23
24
|
end
|
@@ -0,0 +1,56 @@
|
|
1
|
+
==== Regional definitions
|
2
|
+
The following definition files are included in this installation:
|
3
|
+
|
4
|
+
* generated_definitions/REGIONS
|
5
|
+
* generated_definitions/ar
|
6
|
+
* generated_definitions/at
|
7
|
+
* generated_definitions/au
|
8
|
+
* generated_definitions/be
|
9
|
+
* generated_definitions/br
|
10
|
+
* generated_definitions/ca
|
11
|
+
* generated_definitions/ch
|
12
|
+
* generated_definitions/cl
|
13
|
+
* generated_definitions/cr
|
14
|
+
* generated_definitions/cz
|
15
|
+
* generated_definitions/de
|
16
|
+
* generated_definitions/dk
|
17
|
+
* generated_definitions/ecb_target
|
18
|
+
* generated_definitions/el
|
19
|
+
* generated_definitions/es
|
20
|
+
* generated_definitions/europe
|
21
|
+
* generated_definitions/fed_ex
|
22
|
+
* generated_definitions/federal_reserve
|
23
|
+
* generated_definitions/fi
|
24
|
+
* generated_definitions/fr
|
25
|
+
* generated_definitions/gb
|
26
|
+
* generated_definitions/hr
|
27
|
+
* generated_definitions/hu
|
28
|
+
* generated_definitions/ie
|
29
|
+
* generated_definitions/is
|
30
|
+
* generated_definitions/it
|
31
|
+
* generated_definitions/jp
|
32
|
+
* generated_definitions/li
|
33
|
+
* generated_definitions/lt
|
34
|
+
* generated_definitions/ma
|
35
|
+
* generated_definitions/mx
|
36
|
+
* generated_definitions/nerc
|
37
|
+
* generated_definitions/nl
|
38
|
+
* generated_definitions/no
|
39
|
+
* generated_definitions/north_america
|
40
|
+
* generated_definitions/nyse
|
41
|
+
* generated_definitions/nz
|
42
|
+
* generated_definitions/ph
|
43
|
+
* generated_definitions/pl
|
44
|
+
* generated_definitions/pt
|
45
|
+
* generated_definitions/ro
|
46
|
+
* generated_definitions/scandinavia
|
47
|
+
* generated_definitions/se
|
48
|
+
* generated_definitions/sg
|
49
|
+
* generated_definitions/si
|
50
|
+
* generated_definitions/sk
|
51
|
+
* generated_definitions/united_nations
|
52
|
+
* generated_definitions/ups
|
53
|
+
* generated_definitions/us
|
54
|
+
* generated_definitions/ve
|
55
|
+
* generated_definitions/vi
|
56
|
+
* generated_definitions/za
|
@@ -0,0 +1,4 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
module Holidays
|
3
|
+
REGIONS = [:ar, :at, :au, :au_nsw, :au_vic, :au_qld, :au_nt, :au_act, :au_sa, :au_tas_south, :au_wa, :au_tas, :au_qld_cairns, :au_qld_brisbane, :au_tas_north, :au_vic_melbourne, :be, :br, :ca, :ca_qc, :ca_ab, :ca_on, :ca_sk, :ca_mb, :ca_ns, :ca_pe, :ca_bc, :ca_nf, :ca_nt, :ca_nu, :ca_nb, :ca_yk, :us, :ch_zh, :ch_be, :ch_lu, :ch_ur, :ch_sz, :ch_ow, :ch_nw, :ch_gl, :ch_zg, :ch_fr, :ch_so, :ch_bs, :ch_bl, :ch_sh, :ch_ar, :ch_ai, :ch_sg, :ch_gr, :ch_ag, :ch_tg, :ch_ti, :ch_vd, :ch_ne, :ch_ge, :ch_ju, :ch_vs, :ch, :cl, :cr, :cz, :dk, :de, :de_bw, :de_by, :de_he, :de_nw, :de_rp, :de_sl, :de_st, :de_by_aux, :de_bb, :de_mv, :de_sn, :de_th, :ecb_target, :el, :es_pv, :es_na, :es_an, :es_ib, :es_cm, :es_mu, :es_m, :es_ar, :es_cl, :es_cn, :es_lo, :es_ga, :es_ce, :es_o, :es_ex, :es, :es_ct, :es_v, :es_vc, :federal_reserve, :fedex, :fi, :fr, :gb, :gb_eng, :gb_wls, :gb_eaw, :gb_nir, :gb_sct, :gb_con, :je, :gb_jsy, :gg, :gb_gsy, :im, :gb_iom, :hr, :hu, :ie, :is, :it, :li, :lt, :ma, :mx, :mx_pue, :us, :ca, :nerc, :nl, :no, :nyse, :nz, :nz_sl, :nz_we, :nz_ak, :nz_nl, :nz_ne, :nz_ot, :nz_ta, :nz_sc, :nz_hb, :nz_mb, :nz_ca, :nz_ch, :nz_wl, :ph, :pl, :pt, :ro, :se, :us, :us_dc, :us_ca, :ca, :united_nations, :ups, :za, :ca, :ca_qc, :ca_ab, :ca_on, :ca_sk, :ca_mb, :ca_ns, :ca_pe, :ca_bc, :ca_nf, :ca_nt, :ca_nu, :ca_nb, :ca_yk, :mx, :mx_pue, :us, :us_dc, :us_ca, :dk, :is, :no, :se, :fi, :at, :be, :ch_zh, :ch_be, :ch_lu, :ch_ur, :ch_sz, :ch_ow, :ch_nw, :ch_gl, :ch_zg, :ch_fr, :ch_so, :ch_bs, :ch_bl, :ch_sh, :ch_ar, :ch_ai, :ch_sg, :ch_gr, :ch_ag, :ch_tg, :ch_ti, :ch_vd, :ch_ne, :ch_ge, :ch_ju, :ch_vs, :ch, :cz, :dk, :de, :de_bw, :de_by, :de_he, :de_nw, :de_rp, :de_sl, :de_st, :de_by_aux, :de_bb, :de_mv, :de_sn, :de_th, :el, :es_pv, :es_na, :es_an, :es_ib, :es_cm, :es_mu, :es_m, :es_ar, :es_cl, :es_cn, :es_lo, :es_ga, :es_ce, :es_o, :es_ex, :es, :es_ct, :es_v, :es_vc, :fr, :gb, :gb_eng, :gb_wls, :gb_eaw, :gb_nir, :gb_sct, :gb_con, :je, :gb_jsy, :gg, :gb_gsy, :im, :gb_iom, :hr, :hu, :ie, :is, :it, :li, :lt, :nl, :no, :pl, :pt, :ro, :sk, :si, :jp, :ve, :vi, :sk, :si, :sg]
|
4
|
+
end
|
@@ -2,13 +2,13 @@
|
|
2
2
|
module Holidays
|
3
3
|
# This file is generated by the Ruby Holidays gem.
|
4
4
|
#
|
5
|
-
# Definitions loaded:
|
5
|
+
# Definitions loaded: definitions/ar.yaml
|
6
6
|
#
|
7
7
|
# To use the definitions in this file, load it right after you load the
|
8
8
|
# Holiday gem:
|
9
9
|
#
|
10
10
|
# require 'holidays'
|
11
|
-
# require '
|
11
|
+
# require 'generated_definitions/ar'
|
12
12
|
#
|
13
13
|
# All the definitions are available at https://github.com/alexdunae/holidays
|
14
14
|
module AR # :nodoc:
|
@@ -2,13 +2,13 @@
|
|
2
2
|
module Holidays
|
3
3
|
# This file is generated by the Ruby Holidays gem.
|
4
4
|
#
|
5
|
-
# Definitions loaded:
|
5
|
+
# Definitions loaded: definitions/at.yaml
|
6
6
|
#
|
7
7
|
# To use the definitions in this file, load it right after you load the
|
8
8
|
# Holiday gem:
|
9
9
|
#
|
10
10
|
# require 'holidays'
|
11
|
-
# require '
|
11
|
+
# require 'generated_definitions/at'
|
12
12
|
#
|
13
13
|
# All the definitions are available at https://github.com/alexdunae/holidays
|
14
14
|
module AT # :nodoc:
|
@@ -2,24 +2,24 @@
|
|
2
2
|
module Holidays
|
3
3
|
# This file is generated by the Ruby Holidays gem.
|
4
4
|
#
|
5
|
-
# Definitions loaded:
|
5
|
+
# Definitions loaded: definitions/au.yaml
|
6
6
|
#
|
7
7
|
# To use the definitions in this file, load it right after you load the
|
8
8
|
# Holiday gem:
|
9
9
|
#
|
10
10
|
# require 'holidays'
|
11
|
-
# require '
|
11
|
+
# require 'generated_definitions/au'
|
12
12
|
#
|
13
13
|
# All the definitions are available at https://github.com/alexdunae/holidays
|
14
14
|
module AU # :nodoc:
|
15
15
|
def self.defined_regions
|
16
|
-
[:au, :au_nsw, :au_vic, :au_qld, :au_nt, :au_act, :au_sa, :
|
16
|
+
[:au, :au_nsw, :au_vic, :au_qld, :au_nt, :au_act, :au_sa, :au_tas_south, :au_wa, :au_tas, :au_qld_cairns, :au_qld_brisbane, :au_tas_north, :au_vic_melbourne]
|
17
17
|
end
|
18
18
|
|
19
19
|
def self.holidays_by_month
|
20
20
|
{
|
21
21
|
0 => [{:function => lambda { |year| Holidays.easter(year)-2 }, :function_id => "easter(year)-2", :name => "Good Friday", :regions => [:au]},
|
22
|
-
{:function => lambda { |year| Holidays.easter(year)-1 }, :function_id => "easter(year)-1", :name => "Easter Saturday", :regions => [:au_nsw, :au_vic, :au_qld, :au_nt, :au_act, :au_sa
|
22
|
+
{:function => lambda { |year| Holidays.easter(year)-1 }, :function_id => "easter(year)-1", :name => "Easter Saturday", :regions => [:au_nsw, :au_vic, :au_qld, :au_nt, :au_act, :au_sa]},
|
23
23
|
{:function => lambda { |year| Holidays.easter(year) }, :function_id => "easter(year)", :name => "Easter Sunday", :regions => [:au_nsw, :au_vic]},
|
24
24
|
{:function => lambda { |year| Holidays.easter(year)+1 }, :function_id => "easter(year)+1", :name => "Easter Monday", :regions => [:au]}],
|
25
25
|
1 => [{:mday => 1, :observed => lambda { |date| Holidays.to_monday_if_weekend(date) }, :observed_id => "to_monday_if_weekend", :name => "New Year's Day", :regions => [:au]},
|
@@ -42,19 +42,28 @@ module Holidays
|
|
42
42
|
8 => [{:wday => 3, :week => -3, :name => "Ekka", :regions => [:au_qld_brisbane]}],
|
43
43
|
9 => [{:wday => 1, :week => -1, :name => "Queen's Birthday", :regions => [:au_wa]},
|
44
44
|
{:wday => 1, :week => -1, :name => "Family & Community Day", :regions => [:au_act]}],
|
45
|
-
10 => [{:
|
45
|
+
10 => [{:function => lambda { |year| Holidays.afl_grand_final(year) }, :function_id => "afl_grand_final(year)", :name => "Friday before the AFL Grand Final", :regions => [:au_vic]},
|
46
|
+
{:wday => 1, :week => 1, :name => "Labour Day", :regions => [:au_act, :au_nsw, :au_sa]},
|
46
47
|
{:function => lambda { |year| Holidays.qld_labour_day_october(year) }, :function_id => "qld_labour_day_october(year)", :observed => lambda { |date| Holidays.to_monday_if_weekend(date) }, :observed_id => "to_monday_if_weekend", :name => "Labour Day", :regions => [:au_qld]},
|
47
48
|
{:function => lambda { |year| Holidays.qld_queens_bday_october(year) }, :function_id => "qld_queens_bday_october(year)", :observed => lambda { |date| Holidays.to_monday_if_weekend(date) }, :observed_id => "to_monday_if_weekend", :name => "Queen's Birthday", :regions => [:au_qld]},
|
48
49
|
{:function => lambda { |year| Holidays.hobart_show_day(year) }, :function_id => "hobart_show_day(year)", :name => "Royal Hobart Show", :regions => [:au_tas_south]}],
|
49
50
|
11 => [{:function => lambda { |year| Holidays.g20_day_2014_only(year) }, :function_id => "g20_day_2014_only(year)", :name => "G20 Day", :regions => [:au_qld_brisbane]},
|
50
51
|
{:wday => 1, :week => 1, :name => "Recreation Day", :regions => [:au_tas_north]},
|
51
|
-
{:wday => 2, :week => 1, :name => "Melbourne Cup Day", :regions => [:
|
52
|
+
{:wday => 2, :week => 1, :name => "Melbourne Cup Day", :regions => [:au_vic_melbourne]}],
|
52
53
|
12 => [{:mday => 25, :observed => lambda { |date| Holidays.to_monday_if_weekend(date) }, :observed_id => "to_monday_if_weekend", :name => "Christmas Day", :regions => [:au]},
|
53
|
-
{:mday => 26, :observed => lambda { |date| Holidays.to_weekday_if_boxing_weekend(date) }, :observed_id => "to_weekday_if_boxing_weekend", :name => "Boxing Day", :regions => [:
|
54
|
+
{:mday => 26, :observed => lambda { |date| Holidays.to_weekday_if_boxing_weekend(date) }, :observed_id => "to_weekday_if_boxing_weekend", :name => "Boxing Day", :regions => [:au_nsw, :au_vic, :au_qld, :au_act, :au_wa]},
|
55
|
+
{:function => lambda { |year| Holidays.to_weekday_if_boxing_weekend_from_year(year) }, :function_id => "to_weekday_if_boxing_weekend_from_year(year)", :name => "Boxing Day", :regions => [:au_sa, :au_tas, :au_nt]}]
|
54
56
|
}
|
55
57
|
end
|
56
58
|
end
|
57
59
|
|
60
|
+
def self.afl_grand_final(year)
|
61
|
+
if year == 2015
|
62
|
+
Date.civil(2015, 10, 2)
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
|
58
67
|
# http://www.justice.qld.gov.au/fair-and-safe-work/industrial-relations/public-holidays/dates
|
59
68
|
# celebrated twice in 2012
|
60
69
|
def self.qld_queens_bday_october(year)
|
@@ -65,14 +74,14 @@ end
|
|
65
74
|
# http://www.justice.qld.gov.au/fair-and-safe-work/industrial-relations/public-holidays/dates
|
66
75
|
# changed from may to october after 2012
|
67
76
|
def self.qld_labour_day_may(year)
|
68
|
-
year <= 2012 ?
|
77
|
+
year <= 2012 ? Holidays.calculate_day_of_month(year, 5, 1, 1) : nil
|
69
78
|
end
|
70
79
|
|
71
80
|
|
72
81
|
# http://www.justice.qld.gov.au/fair-and-safe-work/industrial-relations/public-holidays/dates
|
73
82
|
# changed from may to october after 2012
|
74
83
|
def self.qld_labour_day_october(year)
|
75
|
-
year <= 2012 ? nil :
|
84
|
+
year <= 2012 ? nil : Holidays.calculate_day_of_month(year, 10, 1, 1)
|
76
85
|
end
|
77
86
|
|
78
87
|
|
@@ -86,7 +95,7 @@ end
|
|
86
95
|
# http://worksafe.tas.gov.au/__data/assets/pdf_file/0008/287036/Public_Holidays_2014.pdf
|
87
96
|
# The Thursday before the fourth Saturday in October.
|
88
97
|
def self.hobart_show_day(year)
|
89
|
-
fourth_sat_in_oct = Date.civil(year, 10,
|
98
|
+
fourth_sat_in_oct = Date.civil(year, 10, Holidays.calculate_day_of_month(year, 10, 4, :saturday))
|
90
99
|
fourth_sat_in_oct - 2 # the thursday before
|
91
100
|
end
|
92
101
|
|
@@ -2,13 +2,13 @@
|
|
2
2
|
module Holidays
|
3
3
|
# This file is generated by the Ruby Holidays gem.
|
4
4
|
#
|
5
|
-
# Definitions loaded:
|
5
|
+
# Definitions loaded: definitions/be.yaml
|
6
6
|
#
|
7
7
|
# To use the definitions in this file, load it right after you load the
|
8
8
|
# Holiday gem:
|
9
9
|
#
|
10
10
|
# require 'holidays'
|
11
|
-
# require '
|
11
|
+
# require 'generated_definitions/be'
|
12
12
|
#
|
13
13
|
# All the definitions are available at https://github.com/alexdunae/holidays
|
14
14
|
module BE # :nodoc:
|
@@ -2,13 +2,13 @@
|
|
2
2
|
module Holidays
|
3
3
|
# This file is generated by the Ruby Holidays gem.
|
4
4
|
#
|
5
|
-
# Definitions loaded:
|
5
|
+
# Definitions loaded: definitions/br.yaml
|
6
6
|
#
|
7
7
|
# To use the definitions in this file, load it right after you load the
|
8
8
|
# Holiday gem:
|
9
9
|
#
|
10
10
|
# require 'holidays'
|
11
|
-
# require '
|
11
|
+
# require 'generated_definitions/br'
|
12
12
|
#
|
13
13
|
# All the definitions are available at https://github.com/alexdunae/holidays
|
14
14
|
module BR # :nodoc:
|
@@ -2,13 +2,13 @@
|
|
2
2
|
module Holidays
|
3
3
|
# This file is generated by the Ruby Holidays gem.
|
4
4
|
#
|
5
|
-
# Definitions loaded:
|
5
|
+
# Definitions loaded: definitions/ca.yaml, definitions/north_america_informal.yaml
|
6
6
|
#
|
7
7
|
# To use the definitions in this file, load it right after you load the
|
8
8
|
# Holiday gem:
|
9
9
|
#
|
10
10
|
# require 'holidays'
|
11
|
-
# require '
|
11
|
+
# require 'generated_definitions/ca'
|
12
12
|
#
|
13
13
|
# All the definitions are available at https://github.com/alexdunae/holidays
|
14
14
|
module CA # :nodoc:
|
@@ -2,13 +2,13 @@
|
|
2
2
|
module Holidays
|
3
3
|
# This file is generated by the Ruby Holidays gem.
|
4
4
|
#
|
5
|
-
# Definitions loaded:
|
5
|
+
# Definitions loaded: definitions/ch.yaml
|
6
6
|
#
|
7
7
|
# To use the definitions in this file, load it right after you load the
|
8
8
|
# Holiday gem:
|
9
9
|
#
|
10
10
|
# require 'holidays'
|
11
|
-
# require '
|
11
|
+
# require 'generated_definitions/ch'
|
12
12
|
#
|
13
13
|
# All the definitions are available at https://github.com/alexdunae/holidays
|
14
14
|
module CH # :nodoc:
|
@@ -2,13 +2,13 @@
|
|
2
2
|
module Holidays
|
3
3
|
# This file is generated by the Ruby Holidays gem.
|
4
4
|
#
|
5
|
-
# Definitions loaded:
|
5
|
+
# Definitions loaded: definitions/cl.yaml
|
6
6
|
#
|
7
7
|
# To use the definitions in this file, load it right after you load the
|
8
8
|
# Holiday gem:
|
9
9
|
#
|
10
10
|
# require 'holidays'
|
11
|
-
# require '
|
11
|
+
# require 'generated_definitions/cl'
|
12
12
|
#
|
13
13
|
# All the definitions are available at https://github.com/alexdunae/holidays
|
14
14
|
module CL # :nodoc:
|
@@ -2,13 +2,13 @@
|
|
2
2
|
module Holidays
|
3
3
|
# This file is generated by the Ruby Holidays gem.
|
4
4
|
#
|
5
|
-
# Definitions loaded:
|
5
|
+
# Definitions loaded: definitions/cr.yaml
|
6
6
|
#
|
7
7
|
# To use the definitions in this file, load it right after you load the
|
8
8
|
# Holiday gem:
|
9
9
|
#
|
10
10
|
# require 'holidays'
|
11
|
-
# require '
|
11
|
+
# require 'generated_definitions/cr'
|
12
12
|
#
|
13
13
|
# All the definitions are available at https://github.com/alexdunae/holidays
|
14
14
|
module CR # :nodoc:
|
@@ -2,13 +2,13 @@
|
|
2
2
|
module Holidays
|
3
3
|
# This file is generated by the Ruby Holidays gem.
|
4
4
|
#
|
5
|
-
# Definitions loaded:
|
5
|
+
# Definitions loaded: definitions/cz.yaml
|
6
6
|
#
|
7
7
|
# To use the definitions in this file, load it right after you load the
|
8
8
|
# Holiday gem:
|
9
9
|
#
|
10
10
|
# require 'holidays'
|
11
|
-
# require '
|
11
|
+
# require 'generated_definitions/cz'
|
12
12
|
#
|
13
13
|
# All the definitions are available at https://github.com/alexdunae/holidays
|
14
14
|
module CZ # :nodoc:
|
@@ -2,18 +2,18 @@
|
|
2
2
|
module Holidays
|
3
3
|
# This file is generated by the Ruby Holidays gem.
|
4
4
|
#
|
5
|
-
# Definitions loaded:
|
5
|
+
# Definitions loaded: definitions/de.yaml
|
6
6
|
#
|
7
7
|
# To use the definitions in this file, load it right after you load the
|
8
8
|
# Holiday gem:
|
9
9
|
#
|
10
10
|
# require 'holidays'
|
11
|
-
# require '
|
11
|
+
# require 'generated_definitions/de'
|
12
12
|
#
|
13
13
|
# All the definitions are available at https://github.com/alexdunae/holidays
|
14
14
|
module DE # :nodoc:
|
15
15
|
def self.defined_regions
|
16
|
-
[:de, :de_bw, :de_by, :de_he, :de_nw, :de_rp, :de_sl, :de_st, :de_bb, :de_mv, :de_sn, :de_th]
|
16
|
+
[:de, :de_bw, :de_by, :de_he, :de_nw, :de_rp, :de_sl, :de_st, :de_by_aux, :de_bb, :de_mv, :de_sn, :de_th]
|
17
17
|
end
|
18
18
|
|
19
19
|
def self.holidays_by_month
|
@@ -26,7 +26,8 @@ module Holidays
|
|
26
26
|
1 => [{:mday => 1, :name => "Neujahrstag", :regions => [:de]},
|
27
27
|
{:mday => 6, :name => "Heilige Drei Könige", :regions => [:de_bw, :de_by, :de_st]}],
|
28
28
|
5 => [{:mday => 1, :name => "Tag der Arbeit", :regions => [:de]}],
|
29
|
-
8 => [{:mday => 15, :name => "Mariä Himmelfahrt", :regions => [:de_by, :de_sl]}
|
29
|
+
8 => [{:mday => 15, :name => "Mariä Himmelfahrt", :regions => [:de_by, :de_sl]},
|
30
|
+
{:mday => 8, :name => "Friedensfest", :regions => [:de_by_aux]}],
|
30
31
|
10 => [{:mday => 3, :name => "Tag der Deutschen Einheit", :regions => [:de]},
|
31
32
|
{:mday => 31, :name => "Reformationstag", :regions => [:de_bb, :de_mv, :de_sn, :de_st, :de_th]}],
|
32
33
|
11 => [{:mday => 1, :name => "Allerheiligen", :regions => [:de_bw, :de_by, :de_nw, :de_rp, :de_sl]},
|