holidays 4.2.0 → 8.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.gitmodules +3 -0
- data/CHANGELOG.md +195 -0
- data/Makefile +45 -0
- data/README.md +253 -77
- data/Rakefile +10 -11
- data/bin/console +0 -0
- data/bin/setup +1 -0
- data/doc/CONTRIBUTING.md +72 -0
- data/doc/MAINTAINERS.md +81 -0
- data/{REFERENCES → doc/REFERENCES} +0 -0
- data/holidays.gemspec +9 -9
- data/lib/generated_definitions/MANIFEST +26 -4
- data/lib/generated_definitions/REGIONS.rb +3 -1
- data/lib/generated_definitions/ar.rb +4 -10
- data/lib/generated_definitions/at.rb +3 -9
- data/lib/generated_definitions/au.rb +32 -25
- data/lib/generated_definitions/be_fr.rb +2 -8
- data/lib/generated_definitions/be_nl.rb +2 -8
- data/lib/generated_definitions/bg.rb +2 -8
- data/lib/generated_definitions/br.rb +2 -8
- data/lib/generated_definitions/ca.rb +33 -32
- data/lib/generated_definitions/ch.rb +17 -11
- data/lib/generated_definitions/cl.rb +38 -12
- data/lib/generated_definitions/co.rb +121 -0
- data/lib/generated_definitions/cr.rb +2 -8
- data/lib/generated_definitions/cz.rb +2 -8
- data/lib/generated_definitions/de.rb +11 -14
- data/lib/generated_definitions/dk.rb +2 -8
- data/lib/generated_definitions/{ecb_target.rb → ecbtarget.rb} +10 -16
- data/lib/generated_definitions/ee.rb +36 -0
- data/lib/generated_definitions/el.rb +2 -8
- data/lib/generated_definitions/es.rb +8 -11
- data/lib/generated_definitions/europe.rb +121 -51
- data/lib/generated_definitions/federalreserve.rb +34 -0
- data/lib/generated_definitions/{federal_reserve.rb → federalreservebanks.rb} +14 -20
- data/lib/generated_definitions/fedex.rb +3 -9
- data/lib/generated_definitions/fi.rb +2 -8
- data/lib/generated_definitions/fr.rb +6 -10
- data/lib/generated_definitions/gb.rb +12 -16
- data/lib/generated_definitions/ge.rb +41 -0
- data/lib/generated_definitions/hk.rb +106 -0
- data/lib/generated_definitions/hr.rb +10 -14
- data/lib/generated_definitions/hu.rb +4 -9
- data/lib/generated_definitions/ie.rb +3 -17
- data/lib/generated_definitions/is.rb +3 -9
- data/lib/generated_definitions/it.rb +16 -13
- data/lib/generated_definitions/jp.rb +47 -36
- data/lib/generated_definitions/kr.rb +40 -0
- data/lib/generated_definitions/kz.rb +38 -0
- data/lib/generated_definitions/li.rb +2 -8
- data/lib/generated_definitions/lt.rb +2 -8
- data/lib/generated_definitions/lu.rb +35 -0
- data/lib/generated_definitions/lv.rb +52 -0
- data/lib/generated_definitions/ma.rb +2 -8
- data/lib/generated_definitions/mt_en.rb +38 -0
- data/lib/generated_definitions/mt_mt.rb +38 -0
- data/lib/generated_definitions/mx.rb +6 -12
- data/lib/generated_definitions/my.rb +30 -0
- data/lib/generated_definitions/nerc.rb +2 -8
- data/lib/generated_definitions/ng.rb +33 -0
- data/lib/generated_definitions/nl.rb +2 -8
- data/lib/generated_definitions/no.rb +2 -8
- data/lib/generated_definitions/northamerica.rb +223 -0
- data/lib/generated_definitions/nyse.rb +3 -9
- data/lib/generated_definitions/nz.rb +2 -9
- data/lib/generated_definitions/pe.rb +43 -0
- data/lib/generated_definitions/ph.rb +4 -10
- data/lib/generated_definitions/pl.rb +2 -8
- data/lib/generated_definitions/pt.rb +12 -12
- data/lib/generated_definitions/ro.rb +6 -9
- data/lib/generated_definitions/rs_cyrl.rb +39 -0
- data/lib/generated_definitions/rs_la.rb +39 -0
- data/lib/generated_definitions/ru.rb +37 -0
- data/lib/generated_definitions/scandinavia.rb +3 -9
- data/lib/generated_definitions/se.rb +2 -8
- data/lib/generated_definitions/sg.rb +2 -8
- data/lib/generated_definitions/si.rb +2 -8
- data/lib/generated_definitions/sk.rb +2 -8
- data/lib/generated_definitions/southamerica.rb +228 -0
- data/lib/generated_definitions/th.rb +36 -0
- data/lib/generated_definitions/tn.rb +32 -0
- data/lib/generated_definitions/tr.rb +64 -0
- data/lib/generated_definitions/ua.rb +37 -0
- data/lib/generated_definitions/{united_nations.rb → unitednations.rb} +61 -67
- data/lib/generated_definitions/ups.rb +3 -9
- data/lib/generated_definitions/us.rb +113 -23
- data/lib/generated_definitions/ve.rb +2 -8
- data/lib/generated_definitions/vi.rb +6 -11
- data/lib/generated_definitions/za.rb +2 -8
- data/lib/holidays/core_extensions/date.rb +21 -3
- data/lib/holidays/core_extensions/time.rb +23 -0
- data/lib/holidays/date_calculator/day_of_month.rb +3 -3
- data/lib/holidays/date_calculator/lunar_date.rb +371 -0
- data/lib/holidays/date_calculator/weekend_modifier.rb +0 -7
- data/lib/holidays/definition/context/function_processor.rb +91 -0
- data/lib/holidays/definition/context/generator.rb +37 -96
- data/lib/holidays/definition/context/load.rb +29 -0
- data/lib/holidays/definition/context/merger.rb +0 -4
- data/lib/holidays/definition/decorator/test.rb +37 -0
- data/lib/holidays/definition/entity/test.rb +11 -0
- data/lib/holidays/definition/generator/module.rb +54 -0
- data/lib/holidays/definition/generator/regions.rb +55 -0
- data/lib/holidays/definition/generator/test.rb +51 -0
- data/lib/holidays/definition/parser/custom_method.rb +3 -5
- data/lib/holidays/definition/parser/test.rb +86 -0
- data/lib/holidays/definition/repository/cache.rb +23 -9
- data/lib/holidays/definition/repository/holidays_by_month.rb +10 -2
- data/lib/holidays/definition/repository/proc_result_cache.rb +1 -1
- data/lib/holidays/definition/repository/regions.rb +23 -13
- data/lib/holidays/definition/validator/custom_method.rb +1 -1
- data/lib/holidays/definition/validator/region.rb +2 -11
- data/lib/holidays/definition/validator/test.rb +71 -0
- data/lib/holidays/errors.rb +5 -0
- data/lib/holidays/factory/date_calculator.rb +42 -0
- data/lib/holidays/factory/definition.rb +143 -0
- data/lib/holidays/factory/finder.rb +70 -0
- data/lib/holidays/finder/context/between.rb +45 -0
- data/lib/holidays/{use_case → finder}/context/dates_driver_builder.rb +11 -15
- data/lib/holidays/finder/context/next_holiday.rb +57 -0
- data/lib/holidays/finder/context/parse_options.rb +104 -0
- data/lib/holidays/finder/context/search.rb +110 -0
- data/lib/holidays/finder/context/year_holiday.rb +57 -0
- data/lib/holidays/finder/rules/in_region.rb +31 -0
- data/lib/holidays/finder/rules/year_range.rb +58 -0
- data/lib/holidays/load_all_definitions.rb +16 -17
- data/lib/holidays/version.rb +1 -1
- data/lib/holidays.rb +50 -125
- data/test/coverage_report.rb +26 -0
- data/test/data/test_custom_informal_holidays_defs.yaml +11 -0
- data/test/data/test_custom_year_range_holiday_defs.yaml +13 -10
- data/test/data/test_invalid_region.rb +15 -0
- data/test/data/test_multiple_custom_holiday_defs.yaml +7 -4
- 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/data/test_region.rb +15 -0
- data/test/data/test_single_custom_holiday_defs.yaml +7 -4
- data/test/data/test_single_custom_holiday_with_custom_procs.yaml +11 -7
- data/test/defs/test_defs_ar.rb +41 -19
- data/test/defs/test_defs_at.rb +18 -11
- data/test/defs/test_defs_au.rb +185 -126
- data/test/defs/test_defs_be_fr.rb +33 -14
- data/test/defs/test_defs_be_nl.rb +33 -14
- data/test/defs/test_defs_bg.rb +29 -17
- data/test/defs/test_defs_br.rb +33 -19
- data/test/defs/test_defs_ca.rb +246 -136
- data/test/defs/test_defs_ch.rb +35 -23
- data/test/defs/test_defs_cl.rb +57 -27
- data/test/defs/test_defs_co.rb +113 -0
- data/test/defs/test_defs_cr.rb +17 -11
- data/test/defs/test_defs_cz.rb +25 -15
- data/test/defs/test_defs_de.rb +60 -59
- data/test/defs/test_defs_dk.rb +31 -19
- data/test/defs/test_defs_ecbtarget.rb +27 -0
- data/test/defs/test_defs_ee.rb +41 -0
- data/test/defs/test_defs_el.rb +29 -17
- data/test/defs/test_defs_es.rb +116 -52
- data/test/defs/test_defs_europe.rb +1382 -701
- data/test/defs/test_defs_federalreserve.rb +113 -0
- data/test/defs/test_defs_federalreservebanks.rb +247 -0
- data/test/defs/test_defs_fedex.rb +19 -12
- data/test/defs/test_defs_fi.rb +47 -27
- data/test/defs/test_defs_fr.rb +31 -18
- data/test/defs/test_defs_gb.rb +120 -51
- data/test/defs/test_defs_ge.rb +53 -0
- data/test/defs/test_defs_hk.rb +59 -0
- data/test/defs/test_defs_hr.rb +32 -18
- data/test/defs/test_defs_hu.rb +34 -16
- data/test/defs/test_defs_ie.rb +41 -25
- data/test/defs/test_defs_is.rb +39 -22
- data/test/defs/test_defs_it.rb +43 -14
- data/test/defs/test_defs_jp.rb +141 -55
- data/test/defs/test_defs_kr.rb +37 -0
- data/test/defs/test_defs_kz.rb +39 -0
- data/test/defs/test_defs_li.rb +20 -20
- data/test/defs/test_defs_lt.rb +51 -30
- data/test/defs/test_defs_lu.rb +35 -0
- data/test/defs/test_defs_lv.rb +90 -0
- data/test/defs/test_defs_ma.rb +17 -11
- data/test/defs/test_defs_mt_en.rb +41 -0
- data/test/defs/test_defs_mt_mt.rb +41 -0
- data/test/defs/test_defs_mx.rb +34 -23
- data/test/defs/test_defs_my.rb +23 -0
- data/test/defs/test_defs_nerc.rb +17 -11
- data/test/defs/test_defs_ng.rb +29 -0
- data/test/defs/test_defs_nl.rb +21 -13
- data/test/defs/test_defs_no.rb +31 -18
- data/test/defs/test_defs_northamerica.rb +644 -0
- data/test/defs/test_defs_nyse.rb +27 -11
- data/test/defs/test_defs_nz.rb +47 -28
- data/test/defs/test_defs_pe.rb +47 -0
- data/test/defs/test_defs_ph.rb +17 -13
- data/test/defs/test_defs_pl.rb +200 -119
- data/test/defs/test_defs_pt.rb +35 -15
- data/test/defs/test_defs_ro.rb +53 -24
- data/test/defs/test_defs_rs_cyrl.rb +46 -0
- data/test/defs/test_defs_rs_la.rb +46 -0
- data/test/defs/test_defs_ru.rb +34 -0
- data/test/defs/test_defs_scandinavia.rb +193 -116
- data/test/defs/test_defs_se.rb +47 -28
- data/test/defs/test_defs_sg.rb +13 -9
- data/test/defs/test_defs_si.rb +93 -24
- data/test/defs/test_defs_sk.rb +29 -17
- data/test/defs/test_defs_southamerica.rb +307 -0
- data/test/defs/test_defs_th.rb +33 -0
- data/test/defs/test_defs_tn.rb +27 -0
- data/test/defs/test_defs_tr.rb +60 -0
- data/test/defs/test_defs_ua.rb +41 -0
- data/test/defs/{test_defs_united_nations.rb → test_defs_unitednations.rb} +3 -4
- data/test/defs/test_defs_ups.rb +19 -12
- data/test/defs/test_defs_us.rb +370 -30
- data/test/defs/test_defs_ve.rb +23 -16
- data/test/defs/test_defs_vi.rb +10 -6
- data/test/defs/test_defs_za.rb +23 -14
- data/test/holidays/core_extensions/test_date.rb +3 -2
- data/test/holidays/core_extensions/test_date_time.rb +60 -0
- data/test/holidays/date_calculator/test_lunar_date.rb +89 -0
- data/test/holidays/definition/context/test_function_processor.rb +199 -0
- data/test/holidays/definition/context/test_generator.rb +66 -35
- data/test/holidays/definition/context/test_load.rb +37 -0
- data/test/holidays/definition/decorator/test_test.rb +123 -0
- data/test/holidays/definition/generator/test_module.rb +268 -0
- data/test/holidays/definition/generator/test_regions.rb +97 -0
- data/test/holidays/definition/generator/test_test.rb +113 -0
- data/test/holidays/definition/parser/test_custom_method.rb +6 -6
- data/test/holidays/definition/parser/test_test.rb +142 -0
- data/test/holidays/definition/repository/test_cache.rb +47 -6
- data/test/holidays/definition/repository/test_holidays_by_month.rb +121 -1
- data/test/holidays/definition/repository/test_proc_result_cache.rb +8 -1
- data/test/holidays/definition/repository/test_regions.rb +31 -13
- data/test/holidays/definition/validator/test_custom_method.rb +5 -0
- data/test/holidays/definition/validator/test_region.rb +16 -12
- data/test/holidays/definition/validator/test_test.rb +60 -0
- data/test/holidays/finder/context/test_between.rb +172 -0
- data/test/holidays/{use_case → finder}/context/test_dates_driver_builder.rb +2 -2
- data/test/holidays/finder/context/test_next_holiday.rb +156 -0
- data/test/holidays/finder/context/test_parse_options.rb +141 -0
- data/test/holidays/finder/context/test_search.rb +232 -0
- data/test/holidays/finder/context/test_year_holiday.rb +202 -0
- data/test/holidays/finder/rules/test_in_region.rb +42 -0
- data/test/holidays/finder/rules/test_year_range.rb +166 -0
- data/test/integration/README.md +9 -0
- data/test/{test_all_regions.rb → integration/test_all_regions.rb} +18 -4
- data/test/integration/test_any_holidays_during_work_week.rb +90 -0
- data/test/integration/test_available_regions.rb +23 -0
- data/test/{test_custom_holidays.rb → integration/test_custom_holidays.rb} +6 -6
- data/test/integration/test_custom_informal_holidays.rb +15 -0
- data/test/{test_custom_year_range_holidays.rb → integration/test_custom_year_range_holidays.rb} +1 -9
- data/test/{test_holidays.rb → integration/test_holidays.rb} +100 -69
- data/test/{test_holidays_between.rb → integration/test_holidays_between.rb} +19 -17
- data/test/integration/test_multiple_regions.rb +71 -0
- data/test/integration/test_multiple_regions_with_conflict.rb +29 -0
- data/test/integration/test_nonstandard_regions.rb +25 -0
- data/test/test_helper.rb +7 -3
- metadata +204 -132
- data/CONTRIBUTING.md +0 -41
- data/benchmark.rb +0 -8
- data/definitions/README.md +0 -353
- data/definitions/ar.yaml +0 -93
- data/definitions/at.yaml +0 -72
- data/definitions/au.yaml +0 -375
- data/definitions/be_fr.yaml +0 -69
- data/definitions/be_nl.yaml +0 -69
- data/definitions/bg.yaml +0 -127
- data/definitions/br.yaml +0 -77
- data/definitions/ca.yaml +0 -302
- data/definitions/ch.yaml +0 -193
- data/definitions/cl.yaml +0 -94
- data/definitions/cr.yaml +0 -65
- data/definitions/cz.yaml +0 -73
- data/definitions/de.yaml +0 -209
- data/definitions/dk.yaml +0 -130
- data/definitions/ecb_target.yaml +0 -44
- data/definitions/el.yaml +0 -84
- data/definitions/es.yaml +0 -203
- data/definitions/federal_reserve.yaml +0 -114
- data/definitions/fedex.yaml +0 -62
- data/definitions/fi.yaml +0 -115
- data/definitions/fr.yaml +0 -79
- data/definitions/gb.yaml +0 -151
- data/definitions/hr.yaml +0 -79
- data/definitions/hu.yaml +0 -63
- data/definitions/ie.yaml +0 -89
- data/definitions/index.yaml +0 -57
- data/definitions/is.yaml +0 -146
- data/definitions/it.yaml +0 -67
- data/definitions/jp.yaml +0 -316
- data/definitions/li.yaml +0 -107
- data/definitions/lt.yaml +0 -89
- data/definitions/ma.yaml +0 -52
- data/definitions/mx.yaml +0 -106
- data/definitions/nerc.yaml +0 -51
- data/definitions/nl.yaml +0 -73
- data/definitions/no.yaml +0 -90
- data/definitions/north_america_informal.yaml +0 -61
- data/definitions/nyse.yaml +0 -64
- data/definitions/nz.yaml +0 -163
- data/definitions/ph.yaml +0 -94
- data/definitions/pl.yaml +0 -320
- data/definitions/pt.yaml +0 -69
- data/definitions/ro.yaml +0 -78
- data/definitions/se.yaml +0 -120
- data/definitions/sg.yaml +0 -56
- data/definitions/si.yaml +0 -86
- data/definitions/sk.yaml +0 -80
- data/definitions/united_nations.yaml +0 -189
- data/definitions/ups.yaml +0 -62
- data/definitions/us.yaml +0 -103
- data/definitions/ve.yaml +0 -74
- data/definitions/vi.yaml +0 -29
- data/definitions/za.yaml +0 -80
- data/lib/generated_definitions/north_america.rb +0 -126
- data/lib/holidays/date_calculator_factory.rb +0 -35
- data/lib/holidays/definition_factory.rb +0 -86
- data/lib/holidays/option/context/parse_options.rb +0 -106
- data/lib/holidays/option_factory.rb +0 -15
- data/lib/holidays/use_case/context/between.rb +0 -45
- data/lib/holidays/use_case/context/context_common.rb +0 -123
- data/lib/holidays/use_case/context/next_holiday.rb +0 -54
- data/lib/holidays/use_case_factory.rb +0 -31
- data/test/defs/test_defs_ecb_target.rb +0 -23
- data/test/defs/test_defs_federal_reserve.rb +0 -69
- data/test/defs/test_defs_north_america.rb +0 -195
- data/test/holidays/option/context/test_parse_options.rb +0 -74
- data/test/holidays/test_date_calculator_factory.rb +0 -27
- data/test/holidays/test_definition_factory.rb +0 -49
- data/test/holidays/test_option_factory.rb +0 -9
- data/test/holidays/test_use_case_factory.rb +0 -13
- data/test/holidays/use_case/context/test_between.rb +0 -77
- data/test/test_multiple_regions.rb +0 -24
@@ -0,0 +1,33 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
module Holidays
|
3
|
+
# This file is generated by the Ruby Holidays gem.
|
4
|
+
#
|
5
|
+
# Definitions loaded: definitions/ng.yaml
|
6
|
+
#
|
7
|
+
# All the definitions are available at https://github.com/holidays/holidays
|
8
|
+
module NG # :nodoc:
|
9
|
+
def self.defined_regions
|
10
|
+
[:ng]
|
11
|
+
end
|
12
|
+
|
13
|
+
def self.holidays_by_month
|
14
|
+
{
|
15
|
+
0 => [{:function => "easter(year)", :function_arguments => [:year], :function_modifier => -2, :name => "Good Friday", :regions => [:ng]},
|
16
|
+
{:function => "easter(year)", :function_arguments => [:year], :function_modifier => 1, :name => "Easter Monday", :regions => [:ng]}],
|
17
|
+
1 => [{:mday => 1, :observed => "to_monday_if_weekend(date)", :observed_arguments => [:date], :name => "New Year's Day", :regions => [:ng]}],
|
18
|
+
5 => [{:mday => 1, :observed => "to_monday_if_weekend(date)", :observed_arguments => [:date], :name => "Workers' Day", :regions => [:ng]},
|
19
|
+
{:mday => 27, :type => :informal, :name => "Children's Day", :regions => [:ng]}],
|
20
|
+
6 => [{:mday => 12, :year_ranges => { :from => 2018 },:name => "Democracy Day", :regions => [:ng]}],
|
21
|
+
10 => [{:mday => 1, :observed => "to_monday_if_weekend(date)", :observed_arguments => [:date], :name => "Independence Day", :regions => [:ng]}],
|
22
|
+
12 => [{:mday => 25, :observed => "to_monday_if_weekend(date)", :observed_arguments => [:date], :name => "Christmas Day", :regions => [:ng]},
|
23
|
+
{:mday => 26, :observed => "to_weekday_if_boxing_weekend(date)", :observed_arguments => [:date], :name => "Boxing Day", :regions => [:ng]}]
|
24
|
+
}
|
25
|
+
end
|
26
|
+
|
27
|
+
def self.custom_methods
|
28
|
+
{
|
29
|
+
|
30
|
+
}
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -4,12 +4,6 @@ module Holidays
|
|
4
4
|
#
|
5
5
|
# Definitions loaded: definitions/nl.yaml
|
6
6
|
#
|
7
|
-
# To use the definitions in this file, load it right after you load the
|
8
|
-
# Holiday gem:
|
9
|
-
#
|
10
|
-
# require 'holidays'
|
11
|
-
# require 'generated_definitions/nl'
|
12
|
-
#
|
13
7
|
# All the definitions are available at https://github.com/holidays/holidays
|
14
8
|
module NL # :nodoc:
|
15
9
|
def self.defined_regions
|
@@ -18,7 +12,7 @@ module Holidays
|
|
18
12
|
|
19
13
|
def self.holidays_by_month
|
20
14
|
{
|
21
|
-
|
15
|
+
0 => [{:function => "easter(year)", :function_arguments => [:year], :function_modifier => -2, :type => :informal, :name => "Goede Vrijdag", :regions => [:nl]},
|
22
16
|
{:function => "easter(year)", :function_arguments => [:year], :name => "Eerste Paasdag", :regions => [:nl]},
|
23
17
|
{:function => "easter(year)", :function_arguments => [:year], :function_modifier => 1, :name => "Tweede Paasdag", :regions => [:nl]},
|
24
18
|
{:function => "easter(year)", :function_arguments => [:year], :function_modifier => 39, :name => "Hemelvaartsdag", :regions => [:nl]},
|
@@ -36,7 +30,7 @@ module Holidays
|
|
36
30
|
|
37
31
|
def self.custom_methods
|
38
32
|
{
|
39
|
-
|
33
|
+
|
40
34
|
}
|
41
35
|
end
|
42
36
|
end
|
@@ -4,12 +4,6 @@ module Holidays
|
|
4
4
|
#
|
5
5
|
# Definitions loaded: definitions/no.yaml
|
6
6
|
#
|
7
|
-
# To use the definitions in this file, load it right after you load the
|
8
|
-
# Holiday gem:
|
9
|
-
#
|
10
|
-
# require 'holidays'
|
11
|
-
# require 'generated_definitions/no'
|
12
|
-
#
|
13
7
|
# All the definitions are available at https://github.com/holidays/holidays
|
14
8
|
module NO # :nodoc:
|
15
9
|
def self.defined_regions
|
@@ -18,7 +12,7 @@ module Holidays
|
|
18
12
|
|
19
13
|
def self.holidays_by_month
|
20
14
|
{
|
21
|
-
|
15
|
+
0 => [{:function => "easter(year)", :function_arguments => [:year], :function_modifier => -49, :type => :informal, :name => "Fastelavn", :regions => [:no]},
|
22
16
|
{:function => "easter(year)", :function_arguments => [:year], :function_modifier => -7, :name => "Palmesøndag", :regions => [:no]},
|
23
17
|
{:function => "easter(year)", :function_arguments => [:year], :function_modifier => -3, :name => "Skjærtorsdag", :regions => [:no]},
|
24
18
|
{:function => "easter(year)", :function_arguments => [:year], :function_modifier => -2, :name => "Langfredag", :regions => [:no]},
|
@@ -39,7 +33,7 @@ module Holidays
|
|
39
33
|
|
40
34
|
def self.custom_methods
|
41
35
|
{
|
42
|
-
|
36
|
+
|
43
37
|
}
|
44
38
|
end
|
45
39
|
end
|
@@ -0,0 +1,223 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
module Holidays
|
3
|
+
# This file is generated by the Ruby Holidays gem.
|
4
|
+
#
|
5
|
+
# Definitions loaded: definitions/ca.yaml, definitions/mx.yaml, definitions/us.yaml, definitions/northamericainformal.yaml
|
6
|
+
#
|
7
|
+
# All the definitions are available at https://github.com/holidays/holidays
|
8
|
+
module NORTHAMERICA # :nodoc:
|
9
|
+
def self.defined_regions
|
10
|
+
[:ca, :ca_qc, :ca_ab, :ca_sk, :ca_on, :ca_bc, :ca_nb, :ca_mb, :ca_ns, :ca_pe, :ca_nl, :ca_nt, :ca_nu, :ca_yt, :mx, :mx_pue, :us_fl, :us_la, :us, :us_ct, :us_de, :us_gu, :us_hi, :us_in, :us_ky, :us_nj, :us_nc, :us_nd, :us_pr, :us_tn, :us_ms, :us_id, :us_ar, :us_tx, :us_dc, :us_md, :us_va, :us_vt, :us_ak, :us_ca, :us_me, :us_ma, :us_al, :us_ga, :us_ne, :us_mo, :us_sc, :us_wv, :us_vi, :us_ut, :us_ri, :us_az, :us_co, :us_il, :us_mt, :us_nm, :us_ny, :us_oh, :us_pa, :us_mi, :us_mn, :us_nv, :us_or, :us_sd, :us_wa, :us_wi, :us_wy, :us_ia, :us_ks, :us_nh, :us_ok]
|
11
|
+
end
|
12
|
+
|
13
|
+
def self.holidays_by_month
|
14
|
+
{
|
15
|
+
0 => [{:function => "easter(year)", :function_arguments => [:year], :function_modifier => -2, :name => "Good Friday", :regions => [:ca]},
|
16
|
+
{:function => "easter(year)", :function_arguments => [:year], :type => :informal, :name => "Easter Sunday", :regions => [:ca]},
|
17
|
+
{:function => "easter(year)", :function_arguments => [:year], :function_modifier => 1, :type => :informal, :name => "Easter Monday", :regions => [:ca]},
|
18
|
+
{:function => "easter(year)", :function_arguments => [:year], :function_modifier => -47, :name => "Shrove Tuesday", :regions => [:us_fl]},
|
19
|
+
{:function => "easter(year)", :function_arguments => [:year], :function_modifier => -47, :name => "Mardi Gras Day", :regions => [:us_la]},
|
20
|
+
{:function => "easter(year)", :function_arguments => [:year], :function_modifier => -2, :type => :informal, :name => "Good Friday", :regions => [:us]},
|
21
|
+
{:function => "easter(year)", :function_arguments => [:year], :function_modifier => -2, :name => "Good Friday", :regions => [:us_ct, :us_de, :us_gu, :us_hi, :us_in, :us_ky, :us_la, :us_nj, :us_nc, :us_nd, :us_pr, :us_tn]},
|
22
|
+
{:function => "easter(year)", :function_arguments => [:year], :type => :informal, :name => "Easter Sunday", :regions => [:us]}],
|
23
|
+
1 => [{:mday => 1, :observed => "to_monday_if_weekend(date)", :observed_arguments => [:date], :name => "New Year's Day", :regions => [:ca]},
|
24
|
+
{:mday => 2, :name => "New Year's", :regions => [:ca_qc]},
|
25
|
+
{:mday => 1, :name => "Año nuevo", :regions => [:mx]},
|
26
|
+
{:mday => 6, :type => :informal, :name => "Dia de los Santos Reyes", :regions => [:mx]},
|
27
|
+
{:mday => 1, :observed => "to_weekday_if_weekend(date)", :observed_arguments => [:date], :name => "New Year's Day", :regions => [:us]},
|
28
|
+
{:wday => 1, :week => 3, :name => "Martin Luther King's and Robert E. Lee's Birthdays", :regions => [:us_ms]},
|
29
|
+
{:wday => 1, :week => 3, :name => "Idaho Human Rights Day", :regions => [:us_id]},
|
30
|
+
{:wday => 1, :week => 3, :name => "Civil Rights Day", :regions => [:us_ar]},
|
31
|
+
{:wday => 1, :week => 3, :name => "Martin Luther King, Jr. Day", :regions => [:us]},
|
32
|
+
{:function => "us_inauguration_day(year)", :function_arguments => [:year], :name => "Inauguration Day", :regions => [:us_tx, :us_dc, :us_la, :us_md, :us_va]},
|
33
|
+
{:function => "lee_jackson_day(year, month)", :function_arguments => [:year, :month], :name => "Lee-Jackson Day", :regions => [:us_va]},
|
34
|
+
{:mday => 19, :name => "Confederate Heroes Day", :regions => [:us_tx]}],
|
35
|
+
2 => [{:wday => 1, :week => 3, :year_ranges => { :from => 1990 },:name => "Family Day", :regions => [:ca_ab]},
|
36
|
+
{:wday => 1, :week => 3, :year_ranges => { :from => 2007 },:name => "Family Day", :regions => [:ca_sk]},
|
37
|
+
{:wday => 1, :week => 3, :year_ranges => { :from => 2008 },:name => "Family Day", :regions => [:ca_on]},
|
38
|
+
{:wday => 1, :week => 2, :year_ranges => { :between => 2013..2018 },:name => "Family Day", :regions => [:ca_bc]},
|
39
|
+
{:wday => 1, :week => 3, :year_ranges => { :from => 2019 },:name => "Family Day", :regions => [:ca_bc]},
|
40
|
+
{:wday => 1, :week => 3, :year_ranges => { :from => 2018 },:name => "Family Day", :regions => [:ca_nb]},
|
41
|
+
{:wday => 1, :week => 3, :name => "Louis Riel Day", :regions => [:ca_mb]},
|
42
|
+
{:wday => 1, :week => 3, :year_ranges => { :from => 2015 },:name => "Nova Scotia Heritage Day", :regions => [:ca_ns]},
|
43
|
+
{:wday => 1, :week => 3, :name => "Islander Day", :regions => [:ca_pe]},
|
44
|
+
{:wday => 1, :week => 1, :name => "Día de la Constitución", :regions => [:mx]},
|
45
|
+
{:wday => 1, :week => 3, :name => "Presidents' Day", :regions => [:us]},
|
46
|
+
{:mday => 2, :type => :informal, :name => "Groundhog Day", :regions => [:us, :ca]},
|
47
|
+
{:mday => 14, :type => :informal, :name => "Valentine's Day", :regions => [:us, :ca]}],
|
48
|
+
3 => [{:mday => 17, :type => :informal, :name => "St. Patrick's Day", :regions => [:ca_nl]},
|
49
|
+
{:mday => 23, :type => :informal, :name => "St. George's Day", :regions => [:ca_nl]},
|
50
|
+
{:wday => 1, :week => 3, :name => "Natalicio de Benito Juárez", :regions => [:mx]},
|
51
|
+
{:wday => 2, :week => 1, :name => "Town Meeting Day", :regions => [:us_vt]},
|
52
|
+
{:mday => 2, :name => "Texas Independence Day", :regions => [:us_tx]},
|
53
|
+
{:mday => 26, :observed => "to_weekday_if_weekend(date)", :observed_arguments => [:date], :name => "Prince Jonah Kuhio Kalanianaole Day", :regions => [:us_hi]},
|
54
|
+
{:wday => 1, :week => -1, :name => "Seward's Day", :regions => [:us_ak]},
|
55
|
+
{:mday => 31, :name => "César Chávez Day", :regions => [:us_ca]},
|
56
|
+
{:mday => 17, :type => :informal, :name => "St. Patrick's Day", :regions => [:us, :ca]}],
|
57
|
+
5 => [{:function => "ca_victoria_day(year)", :function_arguments => [:year], :name => "Victoria Day", :regions => [:ca_ab, :ca_bc, :ca_mb, :ca_nt, :ca_nu, :ca_on, :ca_sk, :ca_yt]},
|
58
|
+
{:function => "ca_victoria_day(year)", :function_arguments => [:year], :name => "National Patriotes Day", :regions => [:ca_qc]},
|
59
|
+
{:mday => 1, :name => "Día del Trabajo", :regions => [:mx]},
|
60
|
+
{:mday => 5, :type => :informal, :name => "Cinco de Mayo", :regions => [:mx]},
|
61
|
+
{:mday => 5, :type => :informal, :name => "La Batalla de Puebla", :regions => [:mx_pue]},
|
62
|
+
{:mday => 10, :type => :informal, :name => "Día de la Madre", :regions => [:mx]},
|
63
|
+
{:mday => 15, :type => :informal, :name => "Día del Maestro", :regions => [:mx]},
|
64
|
+
{:mday => 8, :name => "Truman Day", :regions => [:us_mo]},
|
65
|
+
{:mday => 10, :name => "Confederate Memorial Day", :regions => [:us_sc]},
|
66
|
+
{:wday => 1, :week => -1, :name => "Memorial Day", :regions => [:us]},
|
67
|
+
{:wday => 0, :week => 2, :type => :informal, :name => "Mother's Day", :regions => [:us, :ca]},
|
68
|
+
{:wday => 6, :week => 3, :type => :informal, :name => "Armed Forces Day", :regions => [:us]}],
|
69
|
+
6 => [{:mday => 24, :type => :informal, :name => "Discovery Day", :regions => [:ca_nl]},
|
70
|
+
{:mday => 24, :name => "Fête Nationale", :regions => [:ca_qc]},
|
71
|
+
{:mday => 21, :name => "National Aboriginal Day", :regions => [:ca_nt]},
|
72
|
+
{:mday => 21, :year_ranges => { :from => 2017 },:name => "National Aboriginal Day", :regions => [:ca_yt]},
|
73
|
+
{:wday => 0, :week => 3, :type => :informal, :name => "Día del Padre", :regions => [:mx]},
|
74
|
+
{:wday => 1, :week => 1, :name => "Jefferson Davis' Birthday", :regions => [:us_al]},
|
75
|
+
{:mday => 3, :name => "Birthday of Jefferson Davis", :regions => [:us_fl]},
|
76
|
+
{:mday => 11, :observed => "to_weekday_if_weekend(date)", :observed_arguments => [:date], :name => "King Kamehameha I Day", :regions => [:us_hi]},
|
77
|
+
{:mday => 19, :name => "Emancipation Day in Texas", :regions => [:us_tx]},
|
78
|
+
{:mday => 20, :observed => "to_weekday_if_weekend(date)", :observed_arguments => [:date], :name => "West Virginia Day", :regions => [:us_wv]},
|
79
|
+
{:wday => 0, :week => 3, :type => :informal, :name => "Father's Day", :regions => [:us, :ca]}],
|
80
|
+
7 => [{:mday => 1, :observed => "to_monday_if_weekend(date)", :observed_arguments => [:date], :name => "Canada Day", :regions => [:ca]},
|
81
|
+
{:mday => 12, :type => :informal, :name => "Orangemen's Day", :regions => [:ca_nl]},
|
82
|
+
{:mday => 9, :year_ranges => { :from => 2020 },:observed => "to_monday_if_weekend(date)", :observed_arguments => [:date], :name => "Nunavut Day", :regions => [:ca_nu]},
|
83
|
+
{:mday => 3, :name => "Emancipation Day", :regions => [:us_vi]},
|
84
|
+
{:mday => 4, :name => "Independence Day", :regions => [:us]},
|
85
|
+
{:mday => 4, :function => "to_weekday_if_weekend(date)", :function_arguments => [:date], :name => "Independence Day (Holiday)", :regions => [:us_va]},
|
86
|
+
{:mday => 24, :name => "Pioneer Day", :regions => [:us_ut]}],
|
87
|
+
8 => [{:wday => 1, :week => 1, :name => "B.C. Day", :regions => [:ca_bc]},
|
88
|
+
{:wday => 1, :week => 1, :name => "Saskatchewan Day", :regions => [:ca_sk]},
|
89
|
+
{:wday => 1, :week => 1, :type => :informal, :name => "Heritage Day", :regions => [:ca_ab]},
|
90
|
+
{:wday => 1, :week => 1, :type => :informal, :name => "Natal Day", :regions => [:ca_ns]},
|
91
|
+
{:wday => 1, :week => 1, :name => "Civic Holiday", :regions => [:ca_nt, :ca_nu]},
|
92
|
+
{:wday => 1, :week => 1, :type => :informal, :name => "Civic Holiday", :regions => [:ca_on, :ca_pe]},
|
93
|
+
{:wday => 1, :week => 1, :name => "New Brunswick Day", :regions => [:ca_nb]},
|
94
|
+
{:wday => 1, :week => 1, :type => :informal, :name => "Terry Fox Day", :regions => [:ca_mb]},
|
95
|
+
{:wday => 1, :week => 3, :name => "Discovery Day", :regions => [:ca_yt]},
|
96
|
+
{:wday => 1, :week => 2, :name => "Victory Day", :regions => [:us_ri]},
|
97
|
+
{:mday => 16, :observed => "to_weekday_if_weekend(date)", :observed_arguments => [:date], :name => "Bennington Battle Day", :regions => [:us_vt]},
|
98
|
+
{:wday => 5, :week => 3, :name => "Statehood Day", :regions => [:us_hi]},
|
99
|
+
{:mday => 27, :name => "Lyndon Baines Johnson Day", :regions => [:us_tx]}],
|
100
|
+
9 => [{:wday => 1, :week => 1, :name => "Labour Day", :regions => [:ca]},
|
101
|
+
{:mday => 15, :name => "Grito de Dolores", :regions => [:mx]},
|
102
|
+
{:mday => 16, :name => "Día de la Independencia", :regions => [:mx]},
|
103
|
+
{:wday => 1, :week => 1, :name => "Labor Day", :regions => [:us]},
|
104
|
+
{:function => "rosh_hashanah(year)", :function_arguments => [:year], :name => "Rosh Hashanah", :regions => [:us_tx]},
|
105
|
+
{:function => "yom_kippur(year)", :function_arguments => [:year], :name => "Yom Kippur", :regions => [:us_tx]}],
|
106
|
+
10 => [{:wday => 1, :week => 2, :name => "Thanksgiving", :regions => [:ca_ab, :ca_bc, :ca_mb, :ca_nt, :ca_nu, :ca_on, :ca_qc, :ca_sk, :ca_yt]},
|
107
|
+
{:mday => 12, :type => :informal, :name => "Día de la Raza", :regions => [:mx]},
|
108
|
+
{:wday => 1, :week => 2, :name => "Columbus Day", :regions => [:us_al, :us_az, :us_co, :us_ct, :us_dc, :us_ga, :us_id, :us_il, :us_in, :us_ma, :us_md, :us_me, :us_mo, :us_mt, :us_ne, :us_nj, :us_nm, :us_ny, :us_oh, :us_pa, :us_ri, :us_ut, :us_va, :us_wv]},
|
109
|
+
{:wday => 1, :week => 2, :type => :informal, :name => "Columbus Day", :regions => [:us_ak, :us_ar, :us_ca, :us_de, :us_fl, :us_hi, :us_mi, :us_mn, :us_nd, :us_nv, :us_or, :us_sd, :us_tx, :us_vt, :us_wa, :us_wi, :us_wy]},
|
110
|
+
{:mday => 18, :name => "Alaska Day", :regions => [:us_ak]},
|
111
|
+
{:wday => 5, :week => -1, :name => "Nevada Day", :regions => [:us_nv]},
|
112
|
+
{:mday => 31, :type => :informal, :name => "Halloween", :regions => [:us, :ca]}],
|
113
|
+
11 => [{:mday => 11, :observed => "to_monday_if_weekend(date)", :observed_arguments => [:date], :name => "Remembrance Day", :regions => [:ca_ab, :ca_sk, :ca_bc, :ca_pe, :ca_nl, :ca_nt, :ca_nu, :ca_nb, :ca_yt]},
|
114
|
+
{:mday => 1, :type => :informal, :name => "Todos los Santos", :regions => [:mx]},
|
115
|
+
{:mday => 2, :type => :informal, :name => "Los Fieles Difuntos", :regions => [:mx]},
|
116
|
+
{:wday => 1, :week => 3, :name => "Día de la Revolución", :regions => [:mx]},
|
117
|
+
{:function => "election_day(year)", :function_arguments => [:year], :name => "Election Day", :regions => [:us_de, :us_hi, :us_in, :us_mt, :us_nj, :us_ny, :us_pa, :us_ri]},
|
118
|
+
{:mday => 11, :observed => "to_weekday_if_weekend(date)", :observed_arguments => [:date], :name => "Veterans Day", :regions => [:us]},
|
119
|
+
{:wday => 4, :week => 4, :name => "Thanksgiving", :regions => [:us]},
|
120
|
+
{:function => "day_after_thanksgiving(year)", :function_arguments => [:year], :name => "Family Day", :regions => [:us_nv]},
|
121
|
+
{:function => "day_after_thanksgiving(year)", :function_arguments => [:year], :name => "State Holiday", :regions => [:us_ga]},
|
122
|
+
{:function => "day_after_thanksgiving(year)", :function_arguments => [:year], :name => "Presidents' Day", :regions => [:us_nm]},
|
123
|
+
{:function => "day_after_thanksgiving(year)", :function_arguments => [:year], :name => "Lincoln's Birthday", :regions => [:us_in]},
|
124
|
+
{:function => "day_after_thanksgiving(year)", :function_arguments => [:year], :name => "American Indian Heritage Day", :regions => [:us_md]},
|
125
|
+
{:function => "day_after_thanksgiving(year)", :function_arguments => [:year], :name => "Day after Thanksgiving (Black Friday)", :regions => [:us_ca, :us_de, :us_fl, :us_ia, :us_il, :us_ks, :us_ky, :us_me, :us_mi, :us_mn, :us_ms, :us_ne, :us_nh, :us_nc, :us_pa, :us_sc, :us_ok, :us_tn, :us_tx, :us_va, :us_wa, :us_wv]}],
|
126
|
+
12 => [{:mday => 25, :observed => "to_weekday_if_weekend(date)", :observed_arguments => [:date], :name => "Christmas Day", :regions => [:ca]},
|
127
|
+
{:mday => 26, :observed => "to_weekday_if_boxing_weekend(date)", :observed_arguments => [:date], :name => "Boxing Day", :regions => [:ca_on]},
|
128
|
+
{:mday => 26, :observed => "to_weekday_if_boxing_weekend(date)", :observed_arguments => [:date], :type => :informal, :name => "Boxing Day", :regions => [:ca_ab, :ca_bc, :ca_mb, :ca_nb, :ca_nl, :ca_nt, :ca_ns, :ca_nu, :ca_pe, :ca_sk, :ca_yt]},
|
129
|
+
{:mday => 12, :type => :informal, :name => "Día de la Virgen de Guadalupe", :regions => [:mx]},
|
130
|
+
{:mday => 24, :type => :informal, :name => "Nochebuena", :regions => [:mx]},
|
131
|
+
{:mday => 25, :name => "Navidad", :regions => [:mx]},
|
132
|
+
{:mday => 28, :type => :informal, :name => "Los Santos Inocentes", :regions => [:mx]},
|
133
|
+
{:mday => 24, :name => "Christmas Eve", :regions => [:us_ar, :us_mi, :us_nc, :us_sc, :us_tx, :us_wi]},
|
134
|
+
{:mday => 24, :function => "christmas_eve_holiday(date)", :function_arguments => [:date], :name => "Christmas Eve (Holiday)", :regions => [:us_mi, :us_sc, :us_va]},
|
135
|
+
{:mday => 25, :observed => "to_weekday_if_weekend(date)", :observed_arguments => [:date], :name => "Christmas Day", :regions => [:us]},
|
136
|
+
{:mday => 26, :name => "Day after Christmas", :regions => [:us_ar, :us_nc, :us_ok, :us_sc, :us_tn, :us_tx]},
|
137
|
+
{:mday => 31, :name => "New Year's Eve", :regions => [:us_mi, :us_wi]}],
|
138
|
+
4 => [{:mday => 30, :type => :informal, :name => "Día del Niño", :regions => [:mx]},
|
139
|
+
{:mday => 16, :observed => "to_weekday_if_weekend(date)", :observed_arguments => [:date], :name => "Emancipation Day", :regions => [:us_dc]},
|
140
|
+
{:wday => 1, :week => 3, :name => "Patriots' Day", :regions => [:us_me, :us_ma]},
|
141
|
+
{:mday => 21, :name => "San Jacinto Day", :regions => [:us_tx]},
|
142
|
+
{:wday => 1, :week => -1, :name => "Confederate Memorial Day", :regions => [:us_al, :us_ms]},
|
143
|
+
{:mday => 26, :observed => "to_monday_if_sunday(date)", :observed_arguments => [:date], :name => "Confederate Memorial Day", :regions => [:us_fl]},
|
144
|
+
{:function => "georgia_state_holiday(year, month)", :function_arguments => [:year, :month], :name => "State Holiday", :regions => [:us_ga]},
|
145
|
+
{:mday => 28, :name => "Arbor Day", :regions => [:us_ne]},
|
146
|
+
{:mday => 1, :type => :informal, :name => "April Fool's Day", :regions => [:us, :ca]},
|
147
|
+
{:mday => 22, :type => :informal, :name => "Earth Day", :regions => [:us, :ca]}]
|
148
|
+
}
|
149
|
+
end
|
150
|
+
|
151
|
+
def self.custom_methods
|
152
|
+
{
|
153
|
+
"ca_victoria_day(year)" => Proc.new { |year|
|
154
|
+
date = Date.civil(year,5,24)
|
155
|
+
if date.wday > 1
|
156
|
+
date -= (date.wday - 1)
|
157
|
+
elsif date.wday == 0
|
158
|
+
date -= 6
|
159
|
+
end
|
160
|
+
date
|
161
|
+
},
|
162
|
+
|
163
|
+
"christmas_eve_holiday(date)" => Proc.new { |date|
|
164
|
+
beginning_of_month = Date.civil(date.year, date.month, 1)
|
165
|
+
(date.saturday? || date.sunday?) ? date.downto(beginning_of_month).find {|d| d if d.wday == 5} : date
|
166
|
+
},
|
167
|
+
|
168
|
+
"rosh_hashanah(year)" => Proc.new { |year|
|
169
|
+
rosh_hashanah_dates = {
|
170
|
+
'2014' => Date.civil(2014, 9, 25),
|
171
|
+
'2015' => Date.civil(2015, 9, 14),
|
172
|
+
'2016' => Date.civil(2016, 10, 3),
|
173
|
+
'2017' => Date.civil(2017, 9, 21),
|
174
|
+
'2018' => Date.civil(2018, 9, 10),
|
175
|
+
'2019' => Date.civil(2019, 9, 30),
|
176
|
+
'2020' => Date.civil(2020, 9, 19)
|
177
|
+
}
|
178
|
+
rosh_hashanah_dates[year.to_s]
|
179
|
+
},
|
180
|
+
|
181
|
+
"yom_kippur(year)" => Proc.new { |year|
|
182
|
+
yom_kippur_dates = {
|
183
|
+
'2014' => Date.civil(2014, 10, 4),
|
184
|
+
'2015' => Date.civil(2015, 9, 23),
|
185
|
+
'2016' => Date.civil(2016, 10, 12),
|
186
|
+
'2017' => Date.civil(2017, 9, 30),
|
187
|
+
'2018' => Date.civil(2018, 9, 19),
|
188
|
+
'2019' => Date.civil(2019, 10, 9),
|
189
|
+
'2020' => Date.civil(2020, 9, 28)
|
190
|
+
}
|
191
|
+
yom_kippur_dates[year.to_s]
|
192
|
+
},
|
193
|
+
|
194
|
+
"georgia_state_holiday(year, month)" => Proc.new { |year, month|
|
195
|
+
beginning_of_month = Date.civil(year, month, 1)
|
196
|
+
state_holiday = Date.civil(year, month, 26)
|
197
|
+
state_holiday.downto(beginning_of_month).find {|date| date if date.wday == 1 }
|
198
|
+
},
|
199
|
+
|
200
|
+
"lee_jackson_day(year, month)" => Proc.new { |year, month|
|
201
|
+
day_of_holiday = Holidays::Factory::DateCalculator.day_of_month_calculator.call(year, month, 3, 1)
|
202
|
+
beginning_of_month = Date.civil(year, month, 1)
|
203
|
+
king_day = Date.civil(year, month, day_of_holiday)
|
204
|
+
king_day.downto(beginning_of_month).find {|date| date if date.wday == 5 }
|
205
|
+
},
|
206
|
+
|
207
|
+
"election_day(year)" => Proc.new { |year|
|
208
|
+
Holidays::Factory::DateCalculator.day_of_month_calculator.call(year, 11, 1, 1) + 1
|
209
|
+
},
|
210
|
+
|
211
|
+
"us_inauguration_day(year)" => Proc.new { |year|
|
212
|
+
year % 4 == 1 ? 20 : nil
|
213
|
+
},
|
214
|
+
|
215
|
+
"day_after_thanksgiving(year)" => Proc.new { |year|
|
216
|
+
Holidays::Factory::DateCalculator.day_of_month_calculator.call(year, 11, 4, 4) + 1
|
217
|
+
},
|
218
|
+
|
219
|
+
|
220
|
+
}
|
221
|
+
end
|
222
|
+
end
|
223
|
+
end
|
@@ -4,12 +4,6 @@ module Holidays
|
|
4
4
|
#
|
5
5
|
# Definitions loaded: definitions/nyse.yaml
|
6
6
|
#
|
7
|
-
# To use the definitions in this file, load it right after you load the
|
8
|
-
# Holiday gem:
|
9
|
-
#
|
10
|
-
# require 'holidays'
|
11
|
-
# require 'generated_definitions/nyse'
|
12
|
-
#
|
13
7
|
# All the definitions are available at https://github.com/holidays/holidays
|
14
8
|
module NYSE # :nodoc:
|
15
9
|
def self.defined_regions
|
@@ -18,8 +12,8 @@ module Holidays
|
|
18
12
|
|
19
13
|
def self.holidays_by_month
|
20
14
|
{
|
21
|
-
|
22
|
-
1 => [{:mday => 1, :name => "New Year's Day", :regions => [:nyse]},
|
15
|
+
0 => [{:function => "easter(year)", :function_arguments => [:year], :function_modifier => -2, :name => "Good Friday", :regions => [:nyse]}],
|
16
|
+
1 => [{:mday => 1, :observed => "to_monday_if_sunday(date)", :observed_arguments => [:date], :name => "New Year's Day", :regions => [:nyse]},
|
23
17
|
{:wday => 1, :week => 3, :name => "Martin Luther King, Jr. Day", :regions => [:nyse]}],
|
24
18
|
2 => [{:wday => 1, :week => 3, :name => "Presidents' Day", :regions => [:nyse]}],
|
25
19
|
5 => [{:wday => 1, :week => -1, :name => "Memorial Day", :regions => [:nyse]}],
|
@@ -32,7 +26,7 @@ module Holidays
|
|
32
26
|
|
33
27
|
def self.custom_methods
|
34
28
|
{
|
35
|
-
|
29
|
+
|
36
30
|
}
|
37
31
|
end
|
38
32
|
end
|
@@ -4,12 +4,6 @@ module Holidays
|
|
4
4
|
#
|
5
5
|
# Definitions loaded: definitions/nz.yaml
|
6
6
|
#
|
7
|
-
# To use the definitions in this file, load it right after you load the
|
8
|
-
# Holiday gem:
|
9
|
-
#
|
10
|
-
# require 'holidays'
|
11
|
-
# require 'generated_definitions/nz'
|
12
|
-
#
|
13
7
|
# All the definitions are available at https://github.com/holidays/holidays
|
14
8
|
module NZ # :nodoc:
|
15
9
|
def self.defined_regions
|
@@ -18,8 +12,7 @@ module Holidays
|
|
18
12
|
|
19
13
|
def self.holidays_by_month
|
20
14
|
{
|
21
|
-
|
22
|
-
{:function => "easter(year)", :function_arguments => [:year], :function_modifier => -1, :name => "Easter Saturday", :regions => [:nz]},
|
15
|
+
0 => [{:function => "easter(year)", :function_arguments => [:year], :function_modifier => -2, :name => "Good Friday", :regions => [:nz]},
|
23
16
|
{:function => "easter(year)", :function_arguments => [:year], :function_modifier => 1, :name => "Easter Monday", :regions => [:nz]}],
|
24
17
|
1 => [{:mday => 1, :observed => "to_monday_if_weekend(date)", :observed_arguments => [:date], :name => "New Year's Day", :regions => [:nz]},
|
25
18
|
{:mday => 2, :observed => "to_weekday_if_boxing_weekend(date)", :observed_arguments => [:date], :name => "Day after New Year's Day", :regions => [:nz]},
|
@@ -47,7 +40,7 @@ module Holidays
|
|
47
40
|
|
48
41
|
def self.custom_methods
|
49
42
|
{
|
50
|
-
|
43
|
+
"closest_monday(date)" => Proc.new { |date|
|
51
44
|
if [1, 2, 3, 4].include?(date.wday)
|
52
45
|
date -= (date.wday - 1)
|
53
46
|
elsif 0 == date.wday
|
@@ -0,0 +1,43 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
module Holidays
|
3
|
+
# This file is generated by the Ruby Holidays gem.
|
4
|
+
#
|
5
|
+
# Definitions loaded: definitions/pe.yaml
|
6
|
+
#
|
7
|
+
# All the definitions are available at https://github.com/holidays/holidays
|
8
|
+
module PE # :nodoc:
|
9
|
+
def self.defined_regions
|
10
|
+
[:pe]
|
11
|
+
end
|
12
|
+
|
13
|
+
def self.holidays_by_month
|
14
|
+
{
|
15
|
+
0 => [{:function => "easter(year)", :function_arguments => [:year], :function_modifier => -3, :name => "Jueves Santo", :regions => [:pe]},
|
16
|
+
{:function => "easter(year)", :function_arguments => [:year], :function_modifier => -2, :name => "Viernes Santo", :regions => [:pe]},
|
17
|
+
{:function => "easter(year)", :function_arguments => [:year], :name => "Pascua", :regions => [:pe]}],
|
18
|
+
1 => [{:mday => 1, :name => "Año Nuevo", :regions => [:pe]},
|
19
|
+
{:mday => 6, :observed => "to_monday_if_sunday(date)", :observed_arguments => [:date], :name => "Día de los Reyes Magos", :regions => [:pe]}],
|
20
|
+
5 => [{:mday => 1, :name => "Día del Trabajador", :regions => [:pe]},
|
21
|
+
{:wday => 0, :week => 2, :type => :informal, :name => "Día de la Madre", :regions => [:pe]}],
|
22
|
+
6 => [{:mday => 7, :type => :informal, :name => "Día de la Bandera", :regions => [:pe]},
|
23
|
+
{:wday => 0, :week => 3, :type => :informal, :name => "Día del Padre", :regions => [:pe]},
|
24
|
+
{:mday => 24, :type => :informal, :name => "Inti Raymi", :regions => [:pe]},
|
25
|
+
{:mday => 29, :name => "San Pablo y San Pedro", :regions => [:pe]}],
|
26
|
+
7 => [{:mday => 28, :name => "Primer Día de la Independencia", :regions => [:pe]},
|
27
|
+
{:mday => 29, :name => "Segundo Día de la Independencia", :regions => [:pe]}],
|
28
|
+
8 => [{:mday => 30, :name => "Santa Rosa de Lima", :regions => [:pe]}],
|
29
|
+
9 => [{:mday => 24, :type => :informal, :name => "Día de las Fuerzas Armadas", :regions => [:pe]}],
|
30
|
+
10 => [{:mday => 8, :name => "Batalla de Angamos", :regions => [:pe]}],
|
31
|
+
11 => [{:mday => 1, :name => "Todos los Santos", :regions => [:pe]}],
|
32
|
+
12 => [{:mday => 8, :observed => "to_monday_if_sunday(date)", :observed_arguments => [:date], :name => "Inmaculada Concepción", :regions => [:pe]},
|
33
|
+
{:mday => 25, :name => "Navidad del Señor", :regions => [:pe]}]
|
34
|
+
}
|
35
|
+
end
|
36
|
+
|
37
|
+
def self.custom_methods
|
38
|
+
{
|
39
|
+
|
40
|
+
}
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
@@ -4,12 +4,6 @@ module Holidays
|
|
4
4
|
#
|
5
5
|
# Definitions loaded: definitions/ph.yaml
|
6
6
|
#
|
7
|
-
# To use the definitions in this file, load it right after you load the
|
8
|
-
# Holiday gem:
|
9
|
-
#
|
10
|
-
# require 'holidays'
|
11
|
-
# require 'generated_definitions/ph'
|
12
|
-
#
|
13
7
|
# All the definitions are available at https://github.com/holidays/holidays
|
14
8
|
module PH # :nodoc:
|
15
9
|
def self.defined_regions
|
@@ -18,18 +12,18 @@ module Holidays
|
|
18
12
|
|
19
13
|
def self.holidays_by_month
|
20
14
|
{
|
21
|
-
|
15
|
+
0 => [{:function => "easter(year)", :function_arguments => [:year], :function_modifier => -3, :name => "Maundy Thursday", :regions => [:ph]},
|
22
16
|
{:function => "easter(year)", :function_arguments => [:year], :function_modifier => -2, :name => "Good Friday", :regions => [:ph]},
|
23
17
|
{:function => "easter(year)", :function_arguments => [:year], :function_modifier => -1, :name => "Holy Saturday", :regions => [:ph]},
|
24
18
|
{:function => "easter(year)", :function_arguments => [:year], :name => "Easter Sunday", :regions => [:ph]}],
|
25
19
|
1 => [{:mday => 1, :name => "New Year’s Day", :regions => [:ph]}],
|
26
|
-
2 => [{:mday => 25, :name => "People Power Anniversary", :regions => [:ph]}],
|
20
|
+
2 => [{:mday => 25, :type => :informal, :name => "People Power Anniversary", :regions => [:ph]}],
|
27
21
|
4 => [{:mday => 9, :name => "The Day of Valor", :regions => [:ph]}],
|
28
22
|
5 => [{:mday => 1, :name => "Labor Day", :regions => [:ph]}],
|
29
23
|
6 => [{:mday => 12, :name => "Independence Day", :regions => [:ph]}],
|
30
24
|
8 => [{:mday => 21, :name => "Ninoy Aquino Day", :regions => [:ph]},
|
31
25
|
{:function => "ph_heroes_day(year)", :function_arguments => [:year], :name => "National Heroes Day", :regions => [:ph]}],
|
32
|
-
11 => [{:mday => 1, :name => "All Saints Day", :regions => [:ph]},
|
26
|
+
11 => [{:mday => 1, :type => :informal, :name => "All Saints Day", :regions => [:ph]},
|
33
27
|
{:mday => 30, :name => "Bonifacio Day", :regions => [:ph]}],
|
34
28
|
12 => [{:mday => 25, :name => "Christmas Day", :regions => [:ph]},
|
35
29
|
{:mday => 30, :name => "Rizal Day", :regions => [:ph]},
|
@@ -39,7 +33,7 @@ module Holidays
|
|
39
33
|
|
40
34
|
def self.custom_methods
|
41
35
|
{
|
42
|
-
|
36
|
+
"ph_heroes_day(year)" => Proc.new { |year|
|
43
37
|
date = Date.new(year, 8, -1)
|
44
38
|
|
45
39
|
if date.wday != 1
|
@@ -4,12 +4,6 @@ module Holidays
|
|
4
4
|
#
|
5
5
|
# Definitions loaded: definitions/pl.yaml
|
6
6
|
#
|
7
|
-
# To use the definitions in this file, load it right after you load the
|
8
|
-
# Holiday gem:
|
9
|
-
#
|
10
|
-
# require 'holidays'
|
11
|
-
# require 'generated_definitions/pl'
|
12
|
-
#
|
13
7
|
# All the definitions are available at https://github.com/holidays/holidays
|
14
8
|
module PL # :nodoc:
|
15
9
|
def self.defined_regions
|
@@ -18,7 +12,7 @@ module Holidays
|
|
18
12
|
|
19
13
|
def self.holidays_by_month
|
20
14
|
{
|
21
|
-
|
15
|
+
0 => [{:function => "easter(year)", :function_arguments => [:year], :function_modifier => -52, :type => :informal, :name => "Tłusty Czwartek", :regions => [:pl]},
|
22
16
|
{:function => "easter(year)", :function_arguments => [:year], :function_modifier => -47, :type => :informal, :name => "Ostatki", :regions => [:pl]},
|
23
17
|
{:function => "easter(year)", :function_arguments => [:year], :function_modifier => -46, :type => :informal, :name => "Środa Popielcowa", :regions => [:pl]},
|
24
18
|
{:function => "easter(year)", :function_arguments => [:year], :function_modifier => -7, :type => :informal, :name => "Niedziela Palmowa", :regions => [:pl]},
|
@@ -63,7 +57,7 @@ module Holidays
|
|
63
57
|
|
64
58
|
def self.custom_methods
|
65
59
|
{
|
66
|
-
|
60
|
+
"pl_trzech_kroli(year)" => Proc.new { |year|
|
67
61
|
year >= 2011 ? 6 : nil
|
68
62
|
},
|
69
63
|
|
@@ -4,36 +4,36 @@ module Holidays
|
|
4
4
|
#
|
5
5
|
# Definitions loaded: definitions/pt.yaml
|
6
6
|
#
|
7
|
-
# To use the definitions in this file, load it right after you load the
|
8
|
-
# Holiday gem:
|
9
|
-
#
|
10
|
-
# require 'holidays'
|
11
|
-
# require 'generated_definitions/pt'
|
12
|
-
#
|
13
7
|
# All the definitions are available at https://github.com/holidays/holidays
|
14
8
|
module PT # :nodoc:
|
15
9
|
def self.defined_regions
|
16
|
-
[:pt]
|
10
|
+
[:pt, :pt_li, :pt_po]
|
17
11
|
end
|
18
12
|
|
19
13
|
def self.holidays_by_month
|
20
14
|
{
|
21
|
-
|
15
|
+
0 => [{:function => "easter(year)", :function_arguments => [:year], :function_modifier => -47, :type => :informal, :name => "Carnaval", :regions => [:pt]},
|
22
16
|
{:function => "easter(year)", :function_arguments => [:year], :function_modifier => -2, :name => "Sexta-feira Santa", :regions => [:pt]},
|
23
|
-
{:function => "easter(year)", :function_arguments => [:year], :name => "Páscoa", :regions => [:pt]}
|
17
|
+
{:function => "easter(year)", :function_arguments => [:year], :name => "Páscoa", :regions => [:pt]},
|
18
|
+
{:function => "easter(year)", :function_arguments => [:year], :function_modifier => 60, :name => "Corpo de Deus", :regions => [:pt]}],
|
24
19
|
1 => [{:mday => 1, :name => "Ano Novo", :regions => [:pt]}],
|
25
20
|
4 => [{:mday => 25, :name => "Dia da Liberdade", :regions => [:pt]}],
|
26
21
|
5 => [{:mday => 1, :name => "Dia do Trabalhador", :regions => [:pt]}],
|
27
|
-
6 => [{:mday => 10, :name => "Dia de Portugal", :regions => [:pt]}
|
22
|
+
6 => [{:mday => 10, :name => "Dia de Portugal", :regions => [:pt]},
|
23
|
+
{:mday => 13, :name => "Dia de Santo António", :regions => [:pt_li]},
|
24
|
+
{:mday => 24, :name => "Dia de São João", :regions => [:pt_po]}],
|
28
25
|
8 => [{:mday => 15, :name => "Assunção de Nossa Senhora", :regions => [:pt]}],
|
29
|
-
|
26
|
+
10 => [{:mday => 5, :name => "Dia da República", :regions => [:pt]}],
|
27
|
+
11 => [{:mday => 1, :name => "Dia de Todos-os-Santos", :regions => [:pt]}],
|
28
|
+
12 => [{:mday => 1, :name => "Restauração da Independência", :regions => [:pt]},
|
29
|
+
{:mday => 8, :name => "Imaculada Conceição", :regions => [:pt]},
|
30
30
|
{:mday => 25, :name => "Natal", :regions => [:pt]}]
|
31
31
|
}
|
32
32
|
end
|
33
33
|
|
34
34
|
def self.custom_methods
|
35
35
|
{
|
36
|
-
|
36
|
+
|
37
37
|
}
|
38
38
|
end
|
39
39
|
end
|
@@ -4,12 +4,6 @@ module Holidays
|
|
4
4
|
#
|
5
5
|
# Definitions loaded: definitions/ro.yaml
|
6
6
|
#
|
7
|
-
# To use the definitions in this file, load it right after you load the
|
8
|
-
# Holiday gem:
|
9
|
-
#
|
10
|
-
# require 'holidays'
|
11
|
-
# require 'generated_definitions/ro'
|
12
|
-
#
|
13
7
|
# All the definitions are available at https://github.com/holidays/holidays
|
14
8
|
module RO # :nodoc:
|
15
9
|
def self.defined_regions
|
@@ -18,13 +12,16 @@ module Holidays
|
|
18
12
|
|
19
13
|
def self.holidays_by_month
|
20
14
|
{
|
21
|
-
|
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]},
|
22
17
|
{:function => "orthodox_easter(year)", :function_arguments => [:year], :function_modifier => 1, :name => "Paștele - luni", :regions => [:ro]},
|
23
18
|
{:function => "orthodox_easter(year)", :function_arguments => [:year], :function_modifier => 49, :name => "Rusaliile - 50", :regions => [:ro]},
|
24
19
|
{:function => "orthodox_easter(year)", :function_arguments => [:year], :function_modifier => 50, :name => "Rusaliile - 51", :regions => [:ro]}],
|
25
20
|
1 => [{:mday => 1, :name => "Anul nou", :regions => [:ro]},
|
26
|
-
{: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]}],
|
27
23
|
5 => [{:mday => 1, :name => "Ziua muncii", :regions => [:ro]}],
|
24
|
+
6 => [{:mday => 1, :year_ranges => { :from => 2017 },:name => "Ziua Copilului", :regions => [:ro]}],
|
28
25
|
8 => [{:mday => 15, :name => "Adormirea Maicii Domnului", :regions => [:ro]}],
|
29
26
|
11 => [{:mday => 30, :name => "Sfântul Apostol Andrei", :regions => [:ro]}],
|
30
27
|
12 => [{:mday => 1, :name => "Ziua Națională", :regions => [:ro]},
|
@@ -35,7 +32,7 @@ module Holidays
|
|
35
32
|
|
36
33
|
def self.custom_methods
|
37
34
|
{
|
38
|
-
|
35
|
+
|
39
36
|
}
|
40
37
|
end
|
41
38
|
end
|