holidays 6.6.1 → 8.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ruby.yml +25 -0
- data/CHANGELOG.md +76 -0
- data/README.md +74 -60
- data/doc/CONTRIBUTING.md +2 -1
- data/holidays.gemspec +10 -5
- data/lib/generated_definitions/MANIFEST +13 -5
- data/lib/generated_definitions/REGIONS.rb +2 -2
- data/lib/generated_definitions/ar.rb +28 -9
- data/lib/generated_definitions/at.rb +2 -2
- data/lib/generated_definitions/au.rb +60 -12
- data/lib/generated_definitions/be_fr.rb +2 -2
- data/lib/generated_definitions/be_nl.rb +2 -2
- data/lib/generated_definitions/bg.rb +2 -2
- data/lib/generated_definitions/br.rb +4 -3
- data/lib/generated_definitions/ca.rb +25 -17
- data/lib/generated_definitions/ch.rb +15 -3
- data/lib/generated_definitions/cl.rb +7 -7
- data/lib/generated_definitions/co.rb +2 -2
- data/lib/generated_definitions/cr.rb +2 -2
- data/lib/generated_definitions/cz.rb +2 -2
- data/lib/generated_definitions/de.rb +12 -7
- data/lib/generated_definitions/dk.rb +3 -3
- data/lib/generated_definitions/{ecb_target.rb → ecbtarget.rb} +10 -10
- data/lib/generated_definitions/ee.rb +2 -2
- data/lib/generated_definitions/el.rb +2 -2
- data/lib/generated_definitions/es.rb +6 -4
- data/lib/generated_definitions/europe.rb +135 -46
- data/lib/generated_definitions/{federal_reserve.rb → federalreserve.rb} +15 -14
- data/lib/generated_definitions/federalreservebanks.rb +35 -0
- data/lib/generated_definitions/fedex.rb +2 -2
- data/lib/generated_definitions/fi.rb +2 -2
- data/lib/generated_definitions/fr.rb +4 -4
- data/lib/generated_definitions/gb.rb +15 -7
- data/lib/generated_definitions/ge.rb +2 -2
- data/lib/generated_definitions/gr.rb +38 -0
- data/lib/generated_definitions/hk.rb +2 -2
- data/lib/generated_definitions/hr.rb +10 -8
- data/lib/generated_definitions/hu.rb +4 -3
- data/lib/generated_definitions/ie.rb +2 -2
- data/lib/generated_definitions/is.rb +2 -2
- data/lib/generated_definitions/it.rb +16 -7
- data/lib/generated_definitions/jp.rb +31 -16
- data/lib/generated_definitions/ke.rb +34 -0
- data/lib/generated_definitions/kr.rb +2 -2
- data/lib/generated_definitions/kz.rb +38 -0
- data/lib/generated_definitions/li.rb +2 -2
- data/lib/generated_definitions/lt.rb +4 -3
- data/lib/generated_definitions/lu.rb +4 -2
- data/lib/generated_definitions/lv.rb +56 -0
- data/lib/generated_definitions/ma.rb +2 -2
- data/lib/generated_definitions/mt_en.rb +2 -2
- data/lib/generated_definitions/mt_mt.rb +2 -2
- data/lib/generated_definitions/mx.rb +7 -7
- data/lib/generated_definitions/my.rb +2 -2
- data/lib/generated_definitions/nerc.rb +2 -2
- data/lib/generated_definitions/ng.rb +33 -0
- data/lib/generated_definitions/nl.rb +2 -2
- data/lib/generated_definitions/no.rb +2 -2
- data/lib/generated_definitions/{north_america.rb → northamerica.rb} +34 -26
- data/lib/generated_definitions/nyse.rb +3 -2
- data/lib/generated_definitions/nz.rb +43 -4
- data/lib/generated_definitions/pe.rb +2 -2
- data/lib/generated_definitions/ph.rb +2 -2
- data/lib/generated_definitions/pl.rb +2 -2
- data/lib/generated_definitions/pt.rb +2 -2
- data/lib/generated_definitions/ro.rb +6 -3
- data/lib/generated_definitions/rs_cyrl.rb +3 -3
- data/lib/generated_definitions/rs_la.rb +3 -3
- data/lib/generated_definitions/ru.rb +2 -2
- data/lib/generated_definitions/scandinavia.rb +3 -3
- data/lib/generated_definitions/se.rb +2 -2
- data/lib/generated_definitions/sg.rb +2 -2
- data/lib/generated_definitions/si.rb +4 -3
- data/lib/generated_definitions/sk.rb +2 -2
- data/lib/generated_definitions/{south_america.rb → southamerica.rb} +33 -13
- data/lib/generated_definitions/th.rb +36 -0
- data/lib/generated_definitions/tn.rb +2 -2
- data/lib/generated_definitions/tr.rb +7 -5
- data/lib/generated_definitions/ua.rb +37 -0
- data/lib/generated_definitions/{united_nations.rb → unitednations.rb} +61 -61
- data/lib/generated_definitions/ups.rb +2 -2
- data/lib/generated_definitions/us.rb +9 -9
- data/lib/generated_definitions/ve.rb +2 -2
- data/lib/generated_definitions/vi.rb +2 -2
- data/lib/generated_definitions/za.rb +3 -3
- data/lib/holidays/definition/context/generator.rb +23 -70
- data/lib/holidays/definition/generator/module.rb +54 -0
- data/lib/holidays/definition/generator/regions.rb +1 -1
- data/lib/holidays/definition/repository/holidays_by_month.rb +9 -1
- data/lib/holidays/factory/definition.rb +7 -0
- data/lib/holidays/finder/context/search.rb +35 -31
- data/lib/holidays/finder/rules/year_range.rb +30 -54
- data/lib/holidays/version.rb +1 -1
- data/lib/holidays.rb +2 -0
- data/test/coverage_report.rb +23 -5
- data/test/data/test_custom_year_range_holiday_defs.yaml +6 -10
- data/test/data/test_multiple_regions_with_conflicts_region_1.yaml +38 -0
- data/test/data/test_multiple_regions_with_conflicts_region_2.yaml +38 -0
- data/test/defs/test_defs_ar.rb +20 -4
- data/test/defs/test_defs_au.rb +33 -0
- data/test/defs/test_defs_br.rb +4 -0
- data/test/defs/test_defs_ca.rb +71 -8
- data/test/defs/test_defs_ch.rb +4 -0
- data/test/defs/test_defs_co.rb +3 -3
- data/test/defs/test_defs_de.rb +10 -0
- data/test/defs/test_defs_dk.rb +4 -0
- data/test/defs/{test_defs_ecb_target.rb → test_defs_ecbtarget.rb} +11 -11
- data/test/defs/test_defs_es.rb +2 -0
- data/test/defs/test_defs_europe.rb +262 -39
- data/test/defs/test_defs_federalreserve.rb +119 -0
- data/test/defs/test_defs_federalreservebanks.rb +251 -0
- data/test/defs/test_defs_fr.rb +3 -3
- data/test/defs/test_defs_gb.rb +42 -0
- data/test/defs/{test_defs_el.rb → test_defs_gr.rb} +18 -18
- data/test/defs/test_defs_hr.rb +6 -6
- data/test/defs/test_defs_hu.rb +12 -4
- data/test/defs/test_defs_it.rb +20 -0
- data/test/defs/test_defs_jp.rb +22 -2
- data/test/defs/test_defs_ke.rb +31 -0
- data/test/defs/test_defs_kz.rb +39 -0
- data/test/defs/test_defs_lt.rb +2 -0
- data/test/defs/test_defs_lu.rb +6 -0
- data/test/defs/test_defs_lv.rb +98 -0
- data/test/defs/test_defs_mx.rb +3 -1
- data/test/defs/test_defs_ng.rb +29 -0
- data/test/defs/{test_defs_north_america.rb → test_defs_northamerica.rb} +85 -20
- data/test/defs/test_defs_nyse.rb +7 -0
- data/test/defs/test_defs_nz.rb +8 -0
- data/test/defs/test_defs_ro.rb +14 -0
- data/test/defs/test_defs_rs_cyrl.rb +1 -1
- data/test/defs/test_defs_rs_la.rb +1 -1
- data/test/defs/test_defs_scandinavia.rb +4 -0
- data/test/defs/{test_defs_south_america.rb → test_defs_southamerica.rb} +29 -9
- data/test/defs/test_defs_th.rb +33 -0
- data/test/defs/test_defs_tr.rb +7 -0
- data/test/defs/test_defs_ua.rb +41 -0
- data/test/defs/{test_defs_united_nations.rb → test_defs_unitednations.rb} +3 -3
- data/test/defs/test_defs_us.rb +11 -11
- data/test/holidays/core_extensions/test_date.rb +3 -2
- data/test/holidays/definition/context/test_generator.rb +17 -20
- data/test/holidays/definition/generator/test_module.rb +268 -0
- data/test/holidays/definition/repository/test_holidays_by_month.rb +121 -1
- data/test/holidays/finder/rules/test_year_range.rb +43 -47
- data/test/integration/test_available_regions.rb +1 -1
- data/test/integration/test_custom_year_range_holidays.rb +0 -7
- data/test/integration/test_holidays.rb +2 -36
- data/test/integration/test_holidays_between.rb +11 -1
- data/test/integration/test_multiple_regions_with_conflict.rb +29 -0
- data/test/integration/test_nonstandard_regions.rb +25 -0
- metadata +71 -35
- data/test/defs/test_defs_federal_reserve.rb +0 -113
@@ -12,7 +12,7 @@ module Holidays
|
|
12
12
|
|
13
13
|
def self.holidays_by_month
|
14
14
|
{
|
15
|
-
|
15
|
+
0 => [{:function => "easter(year)", :function_arguments => [:year], :function_modifier => -47, :type => :informal, :name => "Carnaval", :regions => [:pt]},
|
16
16
|
{:function => "easter(year)", :function_arguments => [:year], :function_modifier => -2, :name => "Sexta-feira Santa", :regions => [:pt]},
|
17
17
|
{:function => "easter(year)", :function_arguments => [:year], :name => "Páscoa", :regions => [:pt]},
|
18
18
|
{:function => "easter(year)", :function_arguments => [:year], :function_modifier => 60, :name => "Corpo de Deus", :regions => [:pt]}],
|
@@ -33,7 +33,7 @@ module Holidays
|
|
33
33
|
|
34
34
|
def self.custom_methods
|
35
35
|
{
|
36
|
-
|
36
|
+
|
37
37
|
}
|
38
38
|
end
|
39
39
|
end
|
@@ -12,13 +12,16 @@ module Holidays
|
|
12
12
|
|
13
13
|
def self.holidays_by_month
|
14
14
|
{
|
15
|
-
|
15
|
+
0 => [{:function => "orthodox_easter(year)", :function_arguments => [:year], :function_modifier => -2, :year_ranges => { :from => 2018 },:name => "Paștele - Vinerea Mare", :regions => [:ro]},
|
16
|
+
{:function => "orthodox_easter(year)", :function_arguments => [:year], :name => "Paștele - duminică", :regions => [:ro]},
|
16
17
|
{:function => "orthodox_easter(year)", :function_arguments => [:year], :function_modifier => 1, :name => "Paștele - luni", :regions => [:ro]},
|
17
18
|
{:function => "orthodox_easter(year)", :function_arguments => [:year], :function_modifier => 49, :name => "Rusaliile - 50", :regions => [:ro]},
|
18
19
|
{:function => "orthodox_easter(year)", :function_arguments => [:year], :function_modifier => 50, :name => "Rusaliile - 51", :regions => [:ro]}],
|
19
20
|
1 => [{:mday => 1, :name => "Anul nou", :regions => [:ro]},
|
20
|
-
{:mday => 2, :name => "Anul nou", :regions => [:ro]}
|
21
|
+
{:mday => 2, :name => "Anul nou", :regions => [:ro]},
|
22
|
+
{:mday => 24, :year_ranges => { :from => 2017 },:name => "Unirea Principatelor Române", :regions => [:ro]}],
|
21
23
|
5 => [{:mday => 1, :name => "Ziua muncii", :regions => [:ro]}],
|
24
|
+
6 => [{:mday => 1, :year_ranges => { :from => 2017 },:name => "Ziua Copilului", :regions => [:ro]}],
|
22
25
|
8 => [{:mday => 15, :name => "Adormirea Maicii Domnului", :regions => [:ro]}],
|
23
26
|
11 => [{:mday => 30, :name => "Sfântul Apostol Andrei", :regions => [:ro]}],
|
24
27
|
12 => [{:mday => 1, :name => "Ziua Națională", :regions => [:ro]},
|
@@ -29,7 +32,7 @@ module Holidays
|
|
29
32
|
|
30
33
|
def self.custom_methods
|
31
34
|
{
|
32
|
-
|
35
|
+
|
33
36
|
}
|
34
37
|
end
|
35
38
|
end
|
@@ -12,7 +12,7 @@ module Holidays
|
|
12
12
|
|
13
13
|
def self.holidays_by_month
|
14
14
|
{
|
15
|
-
|
15
|
+
0 => [{:function => "orthodox_easter(year)", :function_arguments => [:year], :function_modifier => -2, :name => "Велики петак", :regions => [:rs_cyrl]},
|
16
16
|
{:function => "orthodox_easter(year)", :function_arguments => [:year], :function_modifier => -1, :name => "Велика Субота", :regions => [:rs_cyrl]},
|
17
17
|
{:function => "orthodox_easter(year)", :function_arguments => [:year], :name => "Васкрс", :regions => [:rs_cyrl]},
|
18
18
|
{:function => "orthodox_easter(year)", :function_arguments => [:year], :function_modifier => 1, :name => "Васкрсни понедељак", :regions => [:rs_cyrl]}],
|
@@ -24,7 +24,7 @@ module Holidays
|
|
24
24
|
{:mday => 16, :name => "Дан државности Србије", :regions => [:rs_cyrl]}],
|
25
25
|
5 => [{:mday => 1, :name => "Празник рада", :regions => [:rs_cyrl]},
|
26
26
|
{:mday => 2, :name => "Празник рада", :regions => [:rs_cyrl]},
|
27
|
-
{:mday => 9, :name => "Дан победе над фашизмом", :regions => [:rs_cyrl]}],
|
27
|
+
{:mday => 9, :type => :informal, :name => "Дан победе над фашизмом", :regions => [:rs_cyrl]}],
|
28
28
|
6 => [{:mday => 28, :name => "Видовдан", :regions => [:rs_cyrl]}],
|
29
29
|
11 => [{:mday => 11, :name => "Дан примирја", :regions => [:rs_cyrl]}]
|
30
30
|
}
|
@@ -32,7 +32,7 @@ module Holidays
|
|
32
32
|
|
33
33
|
def self.custom_methods
|
34
34
|
{
|
35
|
-
|
35
|
+
|
36
36
|
}
|
37
37
|
end
|
38
38
|
end
|
@@ -12,7 +12,7 @@ module Holidays
|
|
12
12
|
|
13
13
|
def self.holidays_by_month
|
14
14
|
{
|
15
|
-
|
15
|
+
0 => [{:function => "orthodox_easter(year)", :function_arguments => [:year], :function_modifier => -2, :name => "Veliki Petak", :regions => [:rs_la]},
|
16
16
|
{:function => "orthodox_easter(year)", :function_arguments => [:year], :function_modifier => -1, :name => "Velika Subota", :regions => [:rs_la]},
|
17
17
|
{:function => "orthodox_easter(year)", :function_arguments => [:year], :name => "Uskrs", :regions => [:rs_la]},
|
18
18
|
{:function => "orthodox_easter(year)", :function_arguments => [:year], :function_modifier => 1, :name => "Vaskrsni ponedeljak", :regions => [:rs_la]}],
|
@@ -24,7 +24,7 @@ module Holidays
|
|
24
24
|
{:mday => 16, :name => "Dan državnosti Srbije", :regions => [:rs_la]}],
|
25
25
|
5 => [{:mday => 1, :name => "Praznik rada", :regions => [:rs_la]},
|
26
26
|
{:mday => 2, :name => "Praznik rada", :regions => [:rs_la]},
|
27
|
-
{:mday => 9, :name => "Dan pobede", :regions => [:rs_la]}],
|
27
|
+
{:mday => 9, :type => :informal, :name => "Dan pobede", :regions => [:rs_la]}],
|
28
28
|
6 => [{:mday => 28, :name => "Vidovdan", :regions => [:rs_la]}],
|
29
29
|
11 => [{:mday => 11, :name => "Dan primirja", :regions => [:rs_la]}]
|
30
30
|
}
|
@@ -32,7 +32,7 @@ module Holidays
|
|
32
32
|
|
33
33
|
def self.custom_methods
|
34
34
|
{
|
35
|
-
|
35
|
+
|
36
36
|
}
|
37
37
|
end
|
38
38
|
end
|
@@ -12,7 +12,7 @@ module Holidays
|
|
12
12
|
|
13
13
|
def self.holidays_by_month
|
14
14
|
{
|
15
|
-
|
15
|
+
1 => [{:mday => 1, :name => "Новый год", :regions => [:ru]},
|
16
16
|
{:mday => 2, :name => "Новогодний праздник", :regions => [:ru]},
|
17
17
|
{:mday => 3, :name => "Новогодний праздник", :regions => [:ru]},
|
18
18
|
{:mday => 4, :name => "Новогодний праздник", :regions => [:ru]},
|
@@ -30,7 +30,7 @@ module Holidays
|
|
30
30
|
|
31
31
|
def self.custom_methods
|
32
32
|
{
|
33
|
-
|
33
|
+
|
34
34
|
}
|
35
35
|
end
|
36
36
|
end
|
@@ -12,13 +12,13 @@ module Holidays
|
|
12
12
|
|
13
13
|
def self.holidays_by_month
|
14
14
|
{
|
15
|
-
|
15
|
+
0 => [{:function => "easter(year)", :function_arguments => [:year], :function_modifier => -49, :type => :informal, :name => "Fastelavn", :regions => [:dk]},
|
16
16
|
{:function => "easter(year)", :function_arguments => [:year], :function_modifier => -7, :type => :informal, :name => "Palmesøndag", :regions => [:dk]},
|
17
17
|
{:function => "easter(year)", :function_arguments => [:year], :function_modifier => -3, :name => "Skærtorsdag", :regions => [:dk]},
|
18
18
|
{:function => "easter(year)", :function_arguments => [:year], :function_modifier => -2, :name => "Langfredag", :regions => [:dk]},
|
19
19
|
{:function => "easter(year)", :function_arguments => [:year], :name => "Påskedag", :regions => [:dk]},
|
20
20
|
{:function => "easter(year)", :function_arguments => [:year], :function_modifier => 1, :name => "2. påskedag", :regions => [:dk]},
|
21
|
-
{:function => "easter(year)", :function_arguments => [:year], :function_modifier => 26, :name => "Store Bededag", :regions => [:dk]},
|
21
|
+
{:function => "easter(year)", :function_arguments => [:year], :function_modifier => 26, :year_ranges => { :until => 2023 },:name => "Store Bededag", :regions => [:dk]},
|
22
22
|
{:function => "easter(year)", :function_arguments => [:year], :function_modifier => 39, :name => "Kristi Himmelfartsdag", :regions => [:dk]},
|
23
23
|
{:function => "easter(year)", :function_arguments => [:year], :function_modifier => 49, :name => "Pinsedag", :regions => [:dk]},
|
24
24
|
{:function => "easter(year)", :function_arguments => [:year], :function_modifier => 50, :name => "2. Pinsedag", :regions => [:dk]},
|
@@ -115,7 +115,7 @@ module Holidays
|
|
115
115
|
|
116
116
|
def self.custom_methods
|
117
117
|
{
|
118
|
-
|
118
|
+
"is_sumardagurinn_fyrsti(year)" => Proc.new { |year|
|
119
119
|
date = Date.civil(year,4,18)
|
120
120
|
if date.wday < 4
|
121
121
|
date += (4 - date.wday)
|
@@ -12,7 +12,7 @@ module Holidays
|
|
12
12
|
|
13
13
|
def self.holidays_by_month
|
14
14
|
{
|
15
|
-
|
15
|
+
0 => [{:function => "easter(year)", :function_arguments => [:year], :function_modifier => -2, :name => "Långfredagen", :regions => [:se]},
|
16
16
|
{:function => "easter(year)", :function_arguments => [:year], :function_modifier => -1, :type => :informal, :name => "Påskafton", :regions => [:se]},
|
17
17
|
{:function => "easter(year)", :function_arguments => [:year], :name => "Påskdagen", :regions => [:se]},
|
18
18
|
{:function => "easter(year)", :function_arguments => [:year], :function_modifier => 1, :name => "Annandag påsk", :regions => [:se]},
|
@@ -34,7 +34,7 @@ module Holidays
|
|
34
34
|
|
35
35
|
def self.custom_methods
|
36
36
|
{
|
37
|
-
|
37
|
+
"se_midsommardagen(year)" => Proc.new { |year|
|
38
38
|
date = Date.civil(year,6,20)
|
39
39
|
date += (6 - date.wday)
|
40
40
|
date
|
@@ -12,7 +12,7 @@ module Holidays
|
|
12
12
|
|
13
13
|
def self.holidays_by_month
|
14
14
|
{
|
15
|
-
|
15
|
+
0 => [{:function => "easter(year)", :function_arguments => [:year], :function_modifier => -2, :name => "Good Friday", :regions => [:sg]}],
|
16
16
|
1 => [{:mday => 1, :observed => "to_weekday_if_weekend(date)", :observed_arguments => [:date], :name => "New Year's Day", :regions => [:sg]}],
|
17
17
|
2 => [{:mday => 14, :type => :informal, :name => "Valentine's Day", :regions => [:sg]},
|
18
18
|
{:mday => 15, :type => :informal, :name => "Total Defence Day", :regions => [:sg]}],
|
@@ -24,7 +24,7 @@ module Holidays
|
|
24
24
|
|
25
25
|
def self.custom_methods
|
26
26
|
{
|
27
|
-
|
27
|
+
|
28
28
|
}
|
29
29
|
end
|
30
30
|
end
|
@@ -12,10 +12,11 @@ module Holidays
|
|
12
12
|
|
13
13
|
def self.holidays_by_month
|
14
14
|
{
|
15
|
-
|
15
|
+
0 => [{:function => "easter(year)", :function_arguments => [:year], :name => "velikonočna nedelja", :regions => [:si]},
|
16
16
|
{:function => "easter(year)", :function_arguments => [:year], :function_modifier => 1, :name => "velikonočni ponedeljek", :regions => [:si]},
|
17
17
|
{:function => "easter(year)", :function_arguments => [:year], :function_modifier => 49, :name => "binkošti", :regions => [:si]}],
|
18
|
-
1 => [{:mday => 1, :name => "novo leto", :regions => [:si]}
|
18
|
+
1 => [{:mday => 1, :name => "novo leto", :regions => [:si]},
|
19
|
+
{:mday => 2, :name => "novo leto", :regions => [:si]}],
|
19
20
|
2 => [{:mday => 8, :name => "Prešernov dan, slovenski kulturni praznik", :regions => [:si]}],
|
20
21
|
4 => [{:mday => 27, :name => "dan upora proti okupatorju", :regions => [:si]}],
|
21
22
|
5 => [{:mday => 1, :name => "praznik dela", :regions => [:si]},
|
@@ -31,7 +32,7 @@ module Holidays
|
|
31
32
|
|
32
33
|
def self.custom_methods
|
33
34
|
{
|
34
|
-
|
35
|
+
|
35
36
|
}
|
36
37
|
end
|
37
38
|
end
|
@@ -12,7 +12,7 @@ module Holidays
|
|
12
12
|
|
13
13
|
def self.holidays_by_month
|
14
14
|
{
|
15
|
-
|
15
|
+
0 => [{:function => "easter(year)", :function_arguments => [:year], :function_modifier => 1, :name => "Veľkonočný pondelok", :regions => [:sk]},
|
16
16
|
{:function => "easter(year)", :function_arguments => [:year], :function_modifier => -2, :name => "Veľký piatok", :regions => [:sk]}],
|
17
17
|
1 => [{:mday => 1, :name => "Nový rok", :regions => [:sk]},
|
18
18
|
{:mday => 6, :name => "Zjavenie Pána (Traja králi)", :regions => [:sk]}],
|
@@ -32,7 +32,7 @@ module Holidays
|
|
32
32
|
|
33
33
|
def self.custom_methods
|
34
34
|
{
|
35
|
-
|
35
|
+
|
36
36
|
}
|
37
37
|
end
|
38
38
|
end
|
@@ -5,14 +5,14 @@ module Holidays
|
|
5
5
|
# Definitions loaded: definitions/ar.yaml, definitions/br.yaml, definitions/cl.yaml, definitions/co.yaml, definitions/pe.yaml, definitions/ve.yaml
|
6
6
|
#
|
7
7
|
# All the definitions are available at https://github.com/holidays/holidays
|
8
|
-
module
|
8
|
+
module SOUTHAMERICA # :nodoc:
|
9
9
|
def self.defined_regions
|
10
10
|
[:ar, :br, :cl, :co, :pe, :ve]
|
11
11
|
end
|
12
12
|
|
13
13
|
def self.holidays_by_month
|
14
14
|
{
|
15
|
-
|
15
|
+
0 => [{:function => "easter(year)", :function_arguments => [:year], :function_modifier => -2, :name => "Viernes Santo", :regions => [:ar]},
|
16
16
|
{:function => "easter(year)", :function_arguments => [:year], :function_modifier => -48, :name => "Carnaval Lunes", :regions => [:ar]},
|
17
17
|
{:function => "easter(year)", :function_arguments => [:year], :function_modifier => -47, :name => "Carnaval Martes", :regions => [:ar]},
|
18
18
|
{:function => "easter(year)", :function_arguments => [:year], :function_modifier => -47, :type => :informal, :name => "Carnaval", :regions => [:br]},
|
@@ -21,8 +21,8 @@ module Holidays
|
|
21
21
|
{:function => "easter(year)", :function_arguments => [:year], :function_modifier => 60, :name => "Corpus Christi", :regions => [:br]},
|
22
22
|
{:function => "easter(year)", :function_arguments => [:year], :function_modifier => -2, :name => "Viernes Santo", :regions => [:cl]},
|
23
23
|
{:function => "easter(year)", :function_arguments => [:year], :function_modifier => -1, :name => "Sábado Santo", :regions => [:cl]},
|
24
|
-
{:function => "st_peter_st_paul_cl(year)", :function_arguments => [:year],
|
25
|
-
{:function => "other_churches_day_cl(year)", :function_arguments => [:year],
|
24
|
+
{:function => "st_peter_st_paul_cl(year)", :function_arguments => [:year], :year_ranges => { :from => 2000 },:name => "San Pedro y San Pablo", :regions => [:cl]},
|
25
|
+
{:function => "other_churches_day_cl(year)", :function_arguments => [:year], :year_ranges => { :from => 2008 },:name => "Día de las Iglesias Evangélicas y Protestantes", :regions => [:cl]},
|
26
26
|
{:function => "easter(year)", :function_arguments => [:year], :function_modifier => -3, :name => "Jueves Santo", :regions => [:co]},
|
27
27
|
{:function => "easter(year)", :function_arguments => [:year], :function_modifier => -2, :name => "Viernes Santo", :regions => [:co]},
|
28
28
|
{:function => "easter(year)", :function_arguments => [:year], :function_modifier => 43, :name => "Día de la Ascensión", :regions => [:co]},
|
@@ -50,6 +50,7 @@ module Holidays
|
|
50
50
|
{:mday => 19, :name => "Declaración Independencia", :regions => [:ve]}],
|
51
51
|
5 => [{:mday => 1, :name => "Día del Trabajador", :regions => [:ar]},
|
52
52
|
{:mday => 25, :name => "Día de la Revolución de Mayo", :regions => [:ar]},
|
53
|
+
{:mday => 24, :year_ranges => { :limited => [2021] },:name => "Feriado con fines turísticos", :regions => [:ar]},
|
53
54
|
{:mday => 1, :name => "Dia do Trabalho", :regions => [:br]},
|
54
55
|
{:mday => 1, :name => "Día del Trabajo", :regions => [:cl]},
|
55
56
|
{:mday => 21, :name => "Día de las Glorias Navales", :regions => [:cl]},
|
@@ -57,15 +58,16 @@ module Holidays
|
|
57
58
|
{:mday => 1, :name => "Día del Trabajador", :regions => [:pe]},
|
58
59
|
{:wday => 0, :week => 2, :type => :informal, :name => "Día de la Madre", :regions => [:pe]},
|
59
60
|
{:mday => 1, :name => "Día del Trabajador", :regions => [:ve]}],
|
60
|
-
6 => [{:mday =>
|
61
|
-
{:mday =>
|
61
|
+
6 => [{:mday => 17, :function => "to_nearest_monday(date)", :function_arguments => [:date], :name => "Paso a la Inmortalidad del General Martín Miguel de Güemes", :regions => [:ar]},
|
62
|
+
{:mday => 20, :name => "Día de la Bandera", :regions => [:ar]},
|
63
|
+
{:mday => 29, :year_ranges => { :until => 1999 },:name => "San Pedro y San Pablo", :regions => [:cl]},
|
62
64
|
{:function => "saint_peter_and_saint_paul(year)", :function_arguments => [:year], :name => "San Pedro y San Pablo", :regions => [:co]},
|
63
65
|
{:mday => 7, :type => :informal, :name => "Día de la Bandera", :regions => [:pe]},
|
64
66
|
{:wday => 0, :week => 3, :type => :informal, :name => "Día del Padre", :regions => [:pe]},
|
65
67
|
{:mday => 24, :type => :informal, :name => "Inti Raymi", :regions => [:pe]},
|
66
68
|
{:mday => 29, :name => "San Pablo y San Pedro", :regions => [:pe]},
|
67
69
|
{:mday => 24, :name => "Aniversario Batalla de Carabobo", :regions => [:ve]}],
|
68
|
-
7 => [{:mday => 8, :name => "Feriado
|
70
|
+
7 => [{:mday => 8, :year_ranges => { :limited => [2016] },:name => "Feriado con fines turísticos", :regions => [:ar]},
|
69
71
|
{:mday => 9, :name => "Día de la Independencia", :regions => [:ar]},
|
70
72
|
{:mday => 16, :name => "Día de la Virgen del Carmen", :regions => [:cl]},
|
71
73
|
{:mday => 20, :name => "Día de la Independencia", :regions => [:co]},
|
@@ -73,27 +75,30 @@ module Holidays
|
|
73
75
|
{:mday => 29, :name => "Segundo Día de la Independencia", :regions => [:pe]},
|
74
76
|
{:mday => 5, :name => "Día de la Independencia", :regions => [:ve]},
|
75
77
|
{:mday => 24, :name => "Natalicio de Simón Bolívar", :regions => [:ve]}],
|
76
|
-
8 => [{:mday =>
|
78
|
+
8 => [{:mday => 17, :function => "to_nearest_monday(date)", :function_arguments => [:date], :name => "Paso a la Inmortalidad del General José de San Martín", :regions => [:ar]},
|
77
79
|
{:mday => 15, :name => "Asunción de la Virgen", :regions => [:cl]},
|
78
80
|
{:mday => 7, :name => "Batalla de Boyacá", :regions => [:co]},
|
79
81
|
{:function => "assumption_of_mary(year)", :function_arguments => [:year], :name => "La Asunción de la Virgen", :regions => [:co]},
|
80
82
|
{:mday => 30, :name => "Santa Rosa de Lima", :regions => [:pe]}],
|
81
|
-
10 => [{:mday => 12, :name => "Día del Respeto a la Diversidad Cultural", :regions => [:ar]},
|
83
|
+
10 => [{:mday => 12, :function => "to_nearest_monday(date)", :function_arguments => [:date], :name => "Día del Respeto a la Diversidad Cultural", :regions => [:ar]},
|
84
|
+
{:mday => 8, :year_ranges => { :limited => [2021] },:name => "Feriado con fines turísticos", :regions => [:ar]},
|
82
85
|
{:mday => 12, :name => "Dia de Nossa Senhora Aparecida", :regions => [:br]},
|
83
|
-
{:mday => 12,
|
84
|
-
{:function => "columbus_day_cl(year)", :function_arguments => [:year],
|
86
|
+
{:mday => 12, :year_ranges => { :until => 1999 },:name => "Encuentro de Dos Mundos", :regions => [:cl]},
|
87
|
+
{:function => "columbus_day_cl(year)", :function_arguments => [:year], :year_ranges => { :from => 2000 },:name => "Encuentro de Dos Mundos", :regions => [:cl]},
|
85
88
|
{:function => "columbus_day(year)", :function_arguments => [:year], :name => "Día de la Raza", :regions => [:co]},
|
86
89
|
{:mday => 8, :name => "Batalla de Angamos", :regions => [:pe]},
|
87
90
|
{:mday => 12, :name => "Día de la Resistencia Indígena", :regions => [:ve]}],
|
88
91
|
11 => [{:mday => 20, :name => "Día de la Soberanía Nacional", :regions => [:ar]},
|
92
|
+
{:mday => 22, :year_ranges => { :limited => [2021] },:name => "Feriado con fines turísticos", :regions => [:ar]},
|
89
93
|
{:mday => 2, :name => "Dia de Finados", :regions => [:br]},
|
90
94
|
{:mday => 15, :name => "Proclamação da República", :regions => [:br]},
|
95
|
+
{:mday => 20, :year_ranges => { :from => 2024 },:name => "Dia Nacional de Zumbi e da Consciência Negra", :regions => [:br]},
|
91
96
|
{:mday => 1, :name => "Día de Todos los Santos", :regions => [:cl]},
|
92
97
|
{:function => "all_saints_day(year)", :function_arguments => [:year], :name => "Día de Todos los Santos", :regions => [:co]},
|
93
98
|
{:function => "independence_of_cartagena(year)", :function_arguments => [:year], :name => "Independencia de Cartagena", :regions => [:co]},
|
94
99
|
{:mday => 1, :name => "Todos los Santos", :regions => [:pe]}],
|
95
100
|
12 => [{:mday => 8, :name => "Inmaculada Concepción de María", :regions => [:ar]},
|
96
|
-
{:mday => 9, :name => "Feriado
|
101
|
+
{:mday => 9, :year_ranges => { :limited => [2016] },:name => "Feriado con fines turísticos", :regions => [:ar]},
|
97
102
|
{:mday => 25, :name => "Navidad", :regions => [:ar]},
|
98
103
|
{:mday => 25, :name => "Natal", :regions => [:br]},
|
99
104
|
{:mday => 8, :name => "Inmaculada Concepción de María", :regions => [:cl]},
|
@@ -112,7 +117,22 @@ module Holidays
|
|
112
117
|
|
113
118
|
def self.custom_methods
|
114
119
|
{
|
115
|
-
|
120
|
+
"to_nearest_monday(date)" => Proc.new { |date|
|
121
|
+
case date.wday
|
122
|
+
when 5
|
123
|
+
date += 3
|
124
|
+
when 4
|
125
|
+
date += 4
|
126
|
+
when 3
|
127
|
+
date -= 2
|
128
|
+
when 2
|
129
|
+
date -= 1
|
130
|
+
end
|
131
|
+
|
132
|
+
date
|
133
|
+
},
|
134
|
+
|
135
|
+
"st_peter_st_paul_cl(year)" => Proc.new { |year|
|
116
136
|
date = Date.civil(year, 6, 29)
|
117
137
|
if [2,3,4].include?(date.wday)
|
118
138
|
date -= (date.wday - 1)
|
@@ -0,0 +1,36 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
module Holidays
|
3
|
+
# This file is generated by the Ruby Holidays gem.
|
4
|
+
#
|
5
|
+
# Definitions loaded: definitions/th.yaml
|
6
|
+
#
|
7
|
+
# All the definitions are available at https://github.com/holidays/holidays
|
8
|
+
module TH # :nodoc:
|
9
|
+
def self.defined_regions
|
10
|
+
[:th]
|
11
|
+
end
|
12
|
+
|
13
|
+
def self.holidays_by_month
|
14
|
+
{
|
15
|
+
1 => [{:mday => 1, :name => "วันขึ้นปีใหม่", :regions => [:th]}],
|
16
|
+
4 => [{:mday => 6, :name => "วันจักรี", :regions => [:th]},
|
17
|
+
{:mday => 13, :name => "วันสงกรานต์", :regions => [:th]},
|
18
|
+
{:mday => 14, :name => "วันสงกรานต์", :regions => [:th]},
|
19
|
+
{:mday => 15, :name => "วันสงกรานต์", :regions => [:th]}],
|
20
|
+
7 => [{:mday => 28, :name => "วันเฉลิมพระชนมพรรษาสมเด็จพระเจ้าอยู่หัวมหาวชิราลงกรณ บดินทรเทพยวรางกูร", :regions => [:th]}],
|
21
|
+
8 => [{:mday => 12, :name => "วันเฉลิมพระชนมพรรษาสมเด็จพระนางเจ้าสิริกิติ์ พระบรมราชินีนาถในรัชกาลที่ ๙", :regions => [:th]}],
|
22
|
+
10 => [{:mday => 13, :name => "วันคล้ายวันสวรรคตพระบาทสมเด็จพระปรมินทรมหาภูมิพลอดุลยเดช บรมนาถบพิตร", :regions => [:th]},
|
23
|
+
{:mday => 23, :name => "วันปิยมหาราช", :regions => [:th]}],
|
24
|
+
12 => [{:mday => 5, :name => "วันคล้ายวันเฉลิมพระชนมพรรษาพระบาทสมเด็จพระปรมินทรมหาภูมิพลอดุลยเดช บรมนาถบพิตร", :regions => [:th]},
|
25
|
+
{:mday => 10, :name => "วันรัฐธรรมนูญ", :regions => [:th]},
|
26
|
+
{:mday => 31, :name => "วันสิ้นปี", :regions => [:th]}]
|
27
|
+
}
|
28
|
+
end
|
29
|
+
|
30
|
+
def self.custom_methods
|
31
|
+
{
|
32
|
+
|
33
|
+
}
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
@@ -12,7 +12,7 @@ module Holidays
|
|
12
12
|
|
13
13
|
def self.holidays_by_month
|
14
14
|
{
|
15
|
-
|
15
|
+
1 => [{:mday => 1, :name => "Jour de l'an", :regions => [:tn]},
|
16
16
|
{:mday => 14, :name => "Fête de la Révolution et de la Jeunesse", :regions => [:tn]}],
|
17
17
|
3 => [{:mday => 20, :name => "Fête de l'Indépendance", :regions => [:tn]}],
|
18
18
|
4 => [{:mday => 9, :name => "Journée des Martyrs", :regions => [:tn]}],
|
@@ -25,7 +25,7 @@ module Holidays
|
|
25
25
|
|
26
26
|
def self.custom_methods
|
27
27
|
{
|
28
|
-
|
28
|
+
|
29
29
|
}
|
30
30
|
end
|
31
31
|
end
|
@@ -12,7 +12,7 @@ module Holidays
|
|
12
12
|
|
13
13
|
def self.holidays_by_month
|
14
14
|
{
|
15
|
-
|
15
|
+
0 => [{:function => "ramadan_feast(year)", :function_arguments => [:year], :name => "Ramazan Bayramı", :regions => [:tr]},
|
16
16
|
{:function => "ramadan_feast(year)", :function_arguments => [:year], :function_modifier => 1, :name => "Ramazan Bayramı (ikinci tatil)", :regions => [:tr]},
|
17
17
|
{:function => "ramadan_feast(year)", :function_arguments => [:year], :function_modifier => 2, :name => "Ramazan Bayramı (üçüncü tatil)", :regions => [:tr]},
|
18
18
|
{:function => "sacrifice_feast(year)", :function_arguments => [:year], :name => "Kurban Bayramı", :regions => [:tr]},
|
@@ -23,7 +23,7 @@ module Holidays
|
|
23
23
|
4 => [{:mday => 23, :name => "Ulusal Egemenlik ve Çocuk Bayramı", :regions => [:tr]}],
|
24
24
|
5 => [{:mday => 1, :name => "Emek ve Dayanışma Günü", :regions => [:tr]},
|
25
25
|
{:mday => 19, :name => "Atatürk'ü Anma Gençlik ve Spor Bayramı", :regions => [:tr]}],
|
26
|
-
7 => [{:mday => 15,
|
26
|
+
7 => [{:mday => 15, :year_ranges => { :from => 2016 },:name => "Demokrasi ve Milli Birlik Günü", :regions => [:tr]}],
|
27
27
|
8 => [{:mday => 30, :name => "Zafer Bayramı", :regions => [:tr]}],
|
28
28
|
10 => [{:mday => 29, :name => "Cumhuriyet Bayramı", :regions => [:tr]}]
|
29
29
|
}
|
@@ -31,14 +31,15 @@ module Holidays
|
|
31
31
|
|
32
32
|
def self.custom_methods
|
33
33
|
{
|
34
|
-
|
34
|
+
"ramadan_feast(year)" => Proc.new { |year|
|
35
35
|
begin_of_ramadan_feast = {
|
36
36
|
'2014' => Date.civil(2014, 7, 28),
|
37
37
|
'2015' => Date.civil(2015, 7, 17),
|
38
38
|
'2016' => Date.civil(2016, 7, 5),
|
39
39
|
'2017' => Date.civil(2017, 6, 25),
|
40
40
|
'2018' => Date.civil(2018, 6, 15),
|
41
|
-
'2019' => Date.civil(2019, 6, 4)
|
41
|
+
'2019' => Date.civil(2019, 6, 4),
|
42
|
+
'2020' => Date.civil(2020, 5, 24)
|
42
43
|
}
|
43
44
|
begin_of_ramadan_feast[year.to_s]
|
44
45
|
},
|
@@ -50,7 +51,8 @@ begin_of_sacrifice_feast = {
|
|
50
51
|
'2016' => Date.civil(2016, 9, 12),
|
51
52
|
'2017' => Date.civil(2017, 9, 1),
|
52
53
|
'2018' => Date.civil(2018, 8, 21),
|
53
|
-
'2019' => Date.civil(2019, 8, 11)
|
54
|
+
'2019' => Date.civil(2019, 8, 11),
|
55
|
+
'2020' => Date.civil(2020, 7, 31)
|
54
56
|
}
|
55
57
|
begin_of_sacrifice_feast[year.to_s]
|
56
58
|
},
|
@@ -0,0 +1,37 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
module Holidays
|
3
|
+
# This file is generated by the Ruby Holidays gem.
|
4
|
+
#
|
5
|
+
# Definitions loaded: definitions/ua.yaml
|
6
|
+
#
|
7
|
+
# All the definitions are available at https://github.com/holidays/holidays
|
8
|
+
module UA # :nodoc:
|
9
|
+
def self.defined_regions
|
10
|
+
[:ua]
|
11
|
+
end
|
12
|
+
|
13
|
+
def self.holidays_by_month
|
14
|
+
{
|
15
|
+
0 => [{:function => "orthodox_easter(year)", :function_arguments => [:year], :observed => "to_monday_if_weekend(date)", :observed_arguments => [:date], :name => "Великдень", :regions => [:ua]},
|
16
|
+
{:function => "orthodox_easter(year)", :function_arguments => [:year], :function_modifier => 49, :observed => "to_monday_if_weekend(date)", :observed_arguments => [:date], :name => "Трійця", :regions => [:ua]}],
|
17
|
+
1 => [{:mday => 1, :observed => "to_monday_if_weekend(date)", :observed_arguments => [:date], :name => "Новий Рік", :regions => [:ua]},
|
18
|
+
{:mday => 7, :observed => "to_monday_if_weekend(date)", :observed_arguments => [:date], :name => "Різдво Христове", :regions => [:ua]}],
|
19
|
+
3 => [{:mday => 8, :observed => "to_monday_if_weekend(date)", :observed_arguments => [:date], :name => "Міжнародний жіночий день", :regions => [:ua]}],
|
20
|
+
5 => [{:mday => 1, :observed => "to_monday_if_weekend(date)", :observed_arguments => [:date], :name => "День праці", :regions => [:ua]},
|
21
|
+
{:mday => 2, :year_ranges => { :until => 2017 },:name => "День міжнародної солідарності трудящих", :regions => [:ua]},
|
22
|
+
{:mday => 9, :observed => "to_monday_if_weekend(date)", :observed_arguments => [:date], :name => "День перемоги над нацизмом у Другій світовій війні", :regions => [:ua]}],
|
23
|
+
6 => [{:mday => 28, :year_ranges => { :from => 1997 },:observed => "to_monday_if_weekend(date)", :observed_arguments => [:date], :name => "День Конституції", :regions => [:ua]}],
|
24
|
+
7 => [{:mday => 16, :year_ranges => { :limited => [1991] },:name => "День Незалежності України", :regions => [:ua]}],
|
25
|
+
8 => [{:mday => 24, :year_ranges => { :from => 1992 },:observed => "to_monday_if_weekend(date)", :observed_arguments => [:date], :name => "День Незалежності", :regions => [:ua]}],
|
26
|
+
10 => [{:mday => 14, :year_ranges => { :from => 2015 },:observed => "to_monday_if_weekend(date)", :observed_arguments => [:date], :name => "День захисника України", :regions => [:ua]}],
|
27
|
+
12 => [{:mday => 25, :year_ranges => { :from => 2017 },:observed => "to_monday_if_weekend(date)", :observed_arguments => [:date], :name => "Різдво Христове", :regions => [:ua]}]
|
28
|
+
}
|
29
|
+
end
|
30
|
+
|
31
|
+
def self.custom_methods
|
32
|
+
{
|
33
|
+
|
34
|
+
}
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|