holidays 0.9.3 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +3 -0
- data/CHANGELOG +7 -0
- data/{README → README.rdoc} +36 -39
- data/data/SYNTAX +1 -1
- data/data/au.yaml +110 -105
- data/data/build_defs.rb +4 -3
- data/data/ca.yaml +140 -140
- data/data/cz.yaml +68 -0
- data/data/de.yaml +12 -14
- data/data/dk.yaml +1 -1
- data/data/es.yaml +1 -1
- data/data/fr.yaml +1 -1
- data/data/gb.yaml +1 -1
- data/data/ie.yaml +1 -1
- data/data/index.yaml +7 -2
- data/data/is.yaml +1 -1
- data/data/it.yaml +1 -1
- data/data/mx.yaml +1 -1
- data/data/nl.yaml +1 -1
- data/data/no.yaml +82 -0
- data/data/nyse.yaml +1 -1
- data/data/nz.yaml +141 -0
- data/data/pt.yaml +1 -1
- data/data/se.yaml +1 -1
- data/data/united_nations.yaml +188 -188
- data/data/ups.yaml +55 -55
- data/data/us.yaml +80 -80
- data/data/za.yaml +1 -1
- data/holidays.gemspec +155 -0
- data/lib/holidays.rb +424 -403
- data/lib/holidays/MANIFEST +28 -25
- data/lib/holidays/au.rb +43 -41
- data/lib/holidays/ca.rb +69 -68
- data/lib/holidays/cz.rb +36 -0
- data/lib/holidays/de.rb +51 -52
- data/lib/holidays/dk.rb +48 -47
- data/lib/holidays/es.rb +53 -52
- data/lib/holidays/europe.rb +236 -215
- data/lib/holidays/fr.rb +37 -36
- data/lib/holidays/gb.rb +41 -40
- data/lib/holidays/ie.rb +33 -32
- data/lib/holidays/is.rb +62 -61
- data/lib/holidays/it.rb +36 -35
- data/lib/holidays/mx.rb +52 -51
- data/lib/holidays/nl.rb +37 -36
- data/lib/holidays/no.rb +40 -0
- data/lib/holidays/north_america.rb +108 -107
- data/lib/holidays/nyse.rb +33 -32
- data/lib/holidays/nz.rb +69 -0
- data/lib/holidays/pt.rb +38 -52
- data/lib/holidays/scandinavia.rb +124 -114
- data/lib/holidays/se.rb +53 -52
- data/lib/holidays/united_nations.rb +25 -24
- data/lib/holidays/ups.rb +32 -31
- data/lib/holidays/us.rb +49 -48
- data/lib/holidays/za.rb +36 -35
- data/rakefile.rb +105 -113
- data/test/defs/test_defs_au.rb +36 -36
- data/test/defs/test_defs_ca.rb +29 -29
- data/test/defs/test_defs_cz.rb +26 -0
- data/test/defs/test_defs_de.rb +51 -46
- data/test/defs/test_defs_dk.rb +30 -30
- data/test/defs/test_defs_es.rb +57 -57
- data/test/defs/test_defs_europe.rb +280 -240
- data/test/defs/test_defs_fr.rb +26 -26
- data/test/defs/test_defs_gb.rb +36 -36
- data/test/defs/test_defs_ie.rb +21 -21
- data/test/defs/test_defs_is.rb +33 -33
- data/test/defs/test_defs_it.rb +25 -25
- data/test/defs/test_defs_mx.rb +22 -22
- data/test/defs/test_defs_nl.rb +24 -24
- data/test/defs/test_defs_no.rb +29 -0
- data/test/defs/test_defs_north_america.rb +54 -54
- data/test/defs/test_defs_nyse.rb +22 -22
- data/test/defs/test_defs_nz.rb +22 -0
- data/test/defs/test_defs_pt.rb +32 -32
- data/test/defs/test_defs_scandinavia.rb +94 -75
- data/test/defs/test_defs_se.rb +32 -32
- data/test/defs/test_defs_ups.rb +21 -21
- data/test/defs/test_defs_us.rb +23 -23
- data/test/defs/test_defs_za.rb +25 -25
- data/test/test_date.rb +123 -0
- data/test/test_helper.rb +22 -0
- data/test/test_holidays.rb +128 -0
- data/test/test_multiple_regions.rb +24 -0
- metadata +126 -73
data/lib/holidays/fr.rb
CHANGED
@@ -1,36 +1,37 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
#
|
4
|
-
#
|
5
|
-
#
|
6
|
-
#
|
7
|
-
#
|
8
|
-
#
|
9
|
-
#
|
10
|
-
# require 'holidays
|
11
|
-
#
|
12
|
-
#
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
{:function => lambda { |year| Holidays.easter(year)+
|
21
|
-
{:function => lambda { |year| Holidays.easter(year)+
|
22
|
-
{:function => lambda { |year| Holidays.easter(year)+
|
23
|
-
|
24
|
-
|
25
|
-
{:mday =>
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
1
|
+
# encoding: utf-8
|
2
|
+
module Holidays
|
3
|
+
# This file is generated by the Ruby Holiday gem.
|
4
|
+
#
|
5
|
+
# Definitions loaded: data/fr.yaml
|
6
|
+
#
|
7
|
+
# To use the definitions in this file, load them right after you load the
|
8
|
+
# Holiday gem:
|
9
|
+
#
|
10
|
+
# require 'holidays'
|
11
|
+
# require 'holidays/fr'
|
12
|
+
#
|
13
|
+
# More definitions are available at http://code.dunae.ca/holidays.
|
14
|
+
module FR # :nodoc:
|
15
|
+
DEFINED_REGIONS = [:fr]
|
16
|
+
|
17
|
+
HOLIDAYS_BY_MONTH = {
|
18
|
+
0 => [{:function => lambda { |year| Holidays.easter(year) }, :function_id => "easter(year)", :name => "Pâques", :regions => [:fr]},
|
19
|
+
{:function => lambda { |year| Holidays.easter(year)+1 }, :function_id => "easter(year)+1", :name => "Lundi de Pâques", :regions => [:fr]},
|
20
|
+
{:function => lambda { |year| Holidays.easter(year)+39 }, :function_id => "easter(year)+39", :name => "Ascension", :regions => [:fr]},
|
21
|
+
{:function => lambda { |year| Holidays.easter(year)+49 }, :function_id => "easter(year)+49", :name => "Pentecôte", :regions => [:fr]},
|
22
|
+
{:function => lambda { |year| Holidays.easter(year)+50 }, :function_id => "easter(year)+50", :name => "Lundi de Pentecôte", :regions => [:fr]}],
|
23
|
+
1 => [{:mday => 1, :name => "Jour de l'an", :regions => [:fr]}],
|
24
|
+
5 => [{:mday => 1, :name => "Fête du travail", :regions => [:fr]},
|
25
|
+
{:mday => 8, :name => "Victoire 1945", :regions => [:fr]}],
|
26
|
+
7 => [{:mday => 14, :name => "Fête nationale", :regions => [:fr]}],
|
27
|
+
8 => [{:mday => 15, :name => "Assomption", :regions => [:fr]}],
|
28
|
+
11 => [{:mday => 1, :name => "Toussaint", :regions => [:fr]},
|
29
|
+
{:mday => 11, :name => "Armistice 1918", :regions => [:fr]}],
|
30
|
+
12 => [{:mday => 25, :name => "Nöel", :regions => [:fr]}]
|
31
|
+
}
|
32
|
+
end
|
33
|
+
|
34
|
+
|
35
|
+
end
|
36
|
+
|
37
|
+
Holidays.merge_defs(Holidays::FR::DEFINED_REGIONS, Holidays::FR::HOLIDAYS_BY_MONTH)
|
data/lib/holidays/gb.rb
CHANGED
@@ -1,40 +1,41 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
#
|
4
|
-
#
|
5
|
-
#
|
6
|
-
#
|
7
|
-
#
|
8
|
-
#
|
9
|
-
#
|
10
|
-
# require 'holidays
|
11
|
-
#
|
12
|
-
#
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
{:
|
20
|
-
|
21
|
-
|
22
|
-
{:
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
{:
|
28
|
-
7 => [{:mday => 5, :name => "Tynwald Day", :regions => [:im, :gb_iom]},
|
29
|
-
{:mday => 12, :name => "Battle of the Boyne", :regions => [:gb_nir]}],
|
30
|
-
8 => [{:wday => 1, :week => 1, :name => "Bank Holiday", :regions => [:gb_sct]},
|
31
|
-
{:wday => 1, :week => -1, :name => "Bank Holiday", :regions => [:gb_eng, :gb_wls, :gb_eaw, :gb_nir]}],
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
1
|
+
# encoding: utf-8
|
2
|
+
module Holidays
|
3
|
+
# This file is generated by the Ruby Holiday gem.
|
4
|
+
#
|
5
|
+
# Definitions loaded: data/gb.yaml
|
6
|
+
#
|
7
|
+
# To use the definitions in this file, load them right after you load the
|
8
|
+
# Holiday gem:
|
9
|
+
#
|
10
|
+
# require 'holidays'
|
11
|
+
# require 'holidays/gb'
|
12
|
+
#
|
13
|
+
# More definitions are available at http://code.dunae.ca/holidays.
|
14
|
+
module GB # :nodoc:
|
15
|
+
DEFINED_REGIONS = [:gb, :gb_eng, :gb_wls, :gb_eaw, :gb_nir, :gb_sct, :gb_con, :je, :gb_jsy, :gg, :gb_gsy, :im, :gb_iom]
|
16
|
+
|
17
|
+
HOLIDAYS_BY_MONTH = {
|
18
|
+
0 => [{:function => lambda { |year| Holidays.easter(year)-2 }, :function_id => "easter(year)-2", :name => "Good Friday", :regions => [:gb]},
|
19
|
+
{:function => lambda { |year| Holidays.easter(year) }, :function_id => "easter(year)", :name => "Easter Sunday", :regions => [:gb]},
|
20
|
+
{:function => lambda { |year| Holidays.easter(year)+1 }, :function_id => "easter(year)+1", :name => "Easter Monday", :regions => [:gb_eng, :gb_wls, :gb_eaw, :gb_nir]}],
|
21
|
+
1 => [{:mday => 1, :name => "New Year's Day", :regions => [:gb]},
|
22
|
+
{:mday => 2, :name => "New Year's", :regions => [:gb_sct]}],
|
23
|
+
3 => [{:mday => 5, :name => "St. Piran's Day", :regions => [:gb_con]},
|
24
|
+
{:mday => 17, :name => "St. Patrick's Day", :regions => [:gb_nir]}],
|
25
|
+
5 => [{:wday => 1, :week => 1, :name => "May Day", :regions => [:gb]},
|
26
|
+
{:mday => 9, :name => "Liberation Day", :regions => [:je, :gb_jsy, :gg, :gb_gsy]},
|
27
|
+
{:wday => 1, :week => -1, :name => "Bank Holiday", :regions => [:gb]}],
|
28
|
+
7 => [{:mday => 5, :name => "Tynwald Day", :regions => [:im, :gb_iom]},
|
29
|
+
{:mday => 12, :name => "Battle of the Boyne", :regions => [:gb_nir]}],
|
30
|
+
8 => [{:wday => 1, :week => 1, :name => "Bank Holiday", :regions => [:gb_sct]},
|
31
|
+
{:wday => 1, :week => -1, :name => "Bank Holiday", :regions => [:gb_eng, :gb_wls, :gb_eaw, :gb_nir]}],
|
32
|
+
11 => [{:mday => 5, :type => :informal, :name => "Guy Fawkes Day", :regions => [:gb]}],
|
33
|
+
12 => [{:mday => 25, :observed => lambda { |date| Holidays.to_monday_if_weekend(date) }, :observed_id => "to_monday_if_weekend", :name => "Christmas Day", :regions => [:gb]},
|
34
|
+
{:mday => 26, :observed => lambda { |date| Holidays.to_weekday_if_boxing_weekend(date) }, :observed_id => "to_weekday_if_boxing_weekend", :name => "Boxing Day", :regions => [:gb]}]
|
35
|
+
}
|
36
|
+
end
|
37
|
+
|
38
|
+
|
39
|
+
end
|
40
|
+
|
41
|
+
Holidays.merge_defs(Holidays::GB::DEFINED_REGIONS, Holidays::GB::HOLIDAYS_BY_MONTH)
|
data/lib/holidays/ie.rb
CHANGED
@@ -1,32 +1,33 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
#
|
4
|
-
#
|
5
|
-
#
|
6
|
-
#
|
7
|
-
#
|
8
|
-
#
|
9
|
-
#
|
10
|
-
# require 'holidays
|
11
|
-
#
|
12
|
-
#
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
0 => [{:function => lambda { |year| Holidays.easter(year)+1 }, :function_id => "easter(year)+1", :name => "Easter Monday", :regions => [:ie]}],
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
8 => [{:wday => 1, :week => 1, :name => "Bank Holiday", :regions => [:ie]}],
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
1
|
+
# encoding: utf-8
|
2
|
+
module Holidays
|
3
|
+
# This file is generated by the Ruby Holiday gem.
|
4
|
+
#
|
5
|
+
# Definitions loaded: data/ie.yaml
|
6
|
+
#
|
7
|
+
# To use the definitions in this file, load them right after you load the
|
8
|
+
# Holiday gem:
|
9
|
+
#
|
10
|
+
# require 'holidays'
|
11
|
+
# require 'holidays/ie'
|
12
|
+
#
|
13
|
+
# More definitions are available at http://code.dunae.ca/holidays.
|
14
|
+
module IE # :nodoc:
|
15
|
+
DEFINED_REGIONS = [:ie]
|
16
|
+
|
17
|
+
HOLIDAYS_BY_MONTH = {
|
18
|
+
0 => [{:function => lambda { |year| Holidays.easter(year)+1 }, :function_id => "easter(year)+1", :name => "Easter Monday", :regions => [:ie]}],
|
19
|
+
1 => [{:mday => 1, :name => "New Year's Day", :regions => [:ie]}],
|
20
|
+
3 => [{:mday => 17, :name => "St. Patrick's Day", :regions => [:ie]}],
|
21
|
+
5 => [{:wday => 1, :week => 1, :name => "May Day", :regions => [:ie]}],
|
22
|
+
6 => [{:wday => 1, :week => 1, :name => "Bank Holiday", :regions => [:ie]}],
|
23
|
+
8 => [{:wday => 1, :week => 1, :name => "Bank Holiday", :regions => [:ie]}],
|
24
|
+
10 => [{:wday => 1, :week => -1, :name => "Bank Holiday", :regions => [:ie]}],
|
25
|
+
12 => [{:mday => 25, :name => "Christmas Day", :regions => [:ie]},
|
26
|
+
{:mday => 26, :name => "St. Stephen's Day", :regions => [:ie]}]
|
27
|
+
}
|
28
|
+
end
|
29
|
+
|
30
|
+
|
31
|
+
end
|
32
|
+
|
33
|
+
Holidays.merge_defs(Holidays::IE::DEFINED_REGIONS, Holidays::IE::HOLIDAYS_BY_MONTH)
|
data/lib/holidays/is.rb
CHANGED
@@ -1,61 +1,62 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
#
|
4
|
-
#
|
5
|
-
#
|
6
|
-
#
|
7
|
-
#
|
8
|
-
#
|
9
|
-
#
|
10
|
-
# require 'holidays
|
11
|
-
#
|
12
|
-
#
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
{:function => lambda { |year| Holidays.easter(year)-
|
21
|
-
{:function => lambda { |year| Holidays.easter(year)-
|
22
|
-
{:function => lambda { |year| Holidays.easter(year)-
|
23
|
-
{:function => lambda { |year| Holidays.easter(year)-
|
24
|
-
{:function => lambda { |year| Holidays.easter(year)
|
25
|
-
{:function => lambda { |year| Holidays.easter(year) }, :function_id => "easter(year)", :name => "
|
26
|
-
{:function => lambda { |year| Holidays.easter(year)+
|
27
|
-
{:function => lambda { |year| Holidays.easter(year)+
|
28
|
-
{:function => lambda { |year| Holidays.easter(year)+
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
{:mday =>
|
36
|
-
|
37
|
-
{:mday =>
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
1
|
+
# encoding: utf-8
|
2
|
+
module Holidays
|
3
|
+
# This file is generated by the Ruby Holiday gem.
|
4
|
+
#
|
5
|
+
# Definitions loaded: data/is.yaml
|
6
|
+
#
|
7
|
+
# To use the definitions in this file, load them right after you load the
|
8
|
+
# Holiday gem:
|
9
|
+
#
|
10
|
+
# require 'holidays'
|
11
|
+
# require 'holidays/is'
|
12
|
+
#
|
13
|
+
# More definitions are available at http://code.dunae.ca/holidays.
|
14
|
+
module IS # :nodoc:
|
15
|
+
DEFINED_REGIONS = [:is]
|
16
|
+
|
17
|
+
HOLIDAYS_BY_MONTH = {
|
18
|
+
0 => [{:function => lambda { |year| Holidays.easter(year)-48 }, :function_id => "easter(year)-48", :name => "Bolludagur", :regions => [:is]},
|
19
|
+
{:function => lambda { |year| Holidays.easter(year)-47 }, :function_id => "easter(year)-47", :name => "Sprengidagur", :regions => [:is]},
|
20
|
+
{:function => lambda { |year| Holidays.easter(year)-46 }, :function_id => "easter(year)-46", :name => "Öskudagur", :regions => [:is]},
|
21
|
+
{:function => lambda { |year| Holidays.easter(year)-7 }, :function_id => "easter(year)-7", :name => "Pálmasunnudagur", :regions => [:is]},
|
22
|
+
{:function => lambda { |year| Holidays.easter(year)-3 }, :function_id => "easter(year)-3", :name => "Skírdagur", :regions => [:is]},
|
23
|
+
{:function => lambda { |year| Holidays.easter(year)-2 }, :function_id => "easter(year)-2", :name => "Föstudaginn langi", :regions => [:is]},
|
24
|
+
{:function => lambda { |year| Holidays.easter(year) }, :function_id => "easter(year)", :name => "Páskadagur", :regions => [:is]},
|
25
|
+
{:function => lambda { |year| Holidays.easter(year)+1 }, :function_id => "easter(year)+1", :name => "Annar í páskum", :regions => [:is]},
|
26
|
+
{:function => lambda { |year| Holidays.easter(year)+39 }, :function_id => "easter(year)+39", :name => "Uppstigningardagur", :regions => [:is]},
|
27
|
+
{:function => lambda { |year| Holidays.easter(year)+49 }, :function_id => "easter(year)+49", :name => "Hvítasunnudagur", :regions => [:is]},
|
28
|
+
{:function => lambda { |year| Holidays.easter(year)+50 }, :function_id => "easter(year)+50", :name => "Annar í hvítasunnu", :regions => [:is]}],
|
29
|
+
1 => [{:mday => 1, :name => "Nýársdagur", :regions => [:is]},
|
30
|
+
{:mday => 6, :name => "Þrettándinn", :regions => [:is]},
|
31
|
+
{:mday => 19, :type => :informal, :name => "Bóndadagur", :regions => [:is]}],
|
32
|
+
2 => [{:mday => 18, :type => :informal, :name => "Konudagur", :regions => [:is]}],
|
33
|
+
4 => [{:function => lambda { |year| Holidays.is_sumardagurinn_fyrsti(year) }, :function_id => "is_sumardagurinn_fyrsti(year)", :name => "Sumardagurinn fyrsti", :regions => [:is]}],
|
34
|
+
5 => [{:mday => 1, :name => "Verkalýðsdagurinn", :regions => [:is]},
|
35
|
+
{:mday => 13, :name => "Mæðradagurinn", :regions => [:is]}],
|
36
|
+
6 => [{:mday => 3, :type => :informal, :name => "Sjómannadagurinn", :regions => [:is]},
|
37
|
+
{:mday => 17, :name => "Lýðveldisdagurinn", :regions => [:is]}],
|
38
|
+
8 => [{:wday => 1, :week => 1, :name => "Frídagur verslunarmanna", :regions => [:is]}],
|
39
|
+
11 => [{:mday => 16, :name => "Dagur íslenskrar tungu", :regions => [:is]}],
|
40
|
+
12 => [{:mday => 24, :name => "Jól", :regions => [:is]},
|
41
|
+
{:mday => 25, :name => "Jól", :regions => [:is]},
|
42
|
+
{:mday => 26, :name => "Jól", :regions => [:is]},
|
43
|
+
{:mday => 31, :name => "Gamlárskvöld", :regions => [:is]}]
|
44
|
+
}
|
45
|
+
end
|
46
|
+
|
47
|
+
# Iceland: first day of summer (Thursday after 18 April)
|
48
|
+
def self.is_sumardagurinn_fyrsti(year)
|
49
|
+
date = Date.civil(year,4,18)
|
50
|
+
if date.wday < 4
|
51
|
+
date += (4 - date.wday)
|
52
|
+
else date
|
53
|
+
date += (11 - date.wday)
|
54
|
+
end
|
55
|
+
date
|
56
|
+
end
|
57
|
+
|
58
|
+
|
59
|
+
|
60
|
+
end
|
61
|
+
|
62
|
+
Holidays.merge_defs(Holidays::IS::DEFINED_REGIONS, Holidays::IS::HOLIDAYS_BY_MONTH)
|
data/lib/holidays/it.rb
CHANGED
@@ -1,35 +1,36 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
#
|
4
|
-
#
|
5
|
-
#
|
6
|
-
#
|
7
|
-
#
|
8
|
-
#
|
9
|
-
#
|
10
|
-
# require 'holidays
|
11
|
-
#
|
12
|
-
#
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
0 => [{:function => lambda { |year| Holidays.easter(year) }, :function_id => "easter(year)", :name => "Pasqua", :regions => [:it]},
|
19
|
-
{:function => lambda { |year| Holidays.easter(year)+1 }, :function_id => "easter(year)+1", :name => "Lunedì dell'Angelo", :regions => [:it]}],
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
1
|
+
# encoding: utf-8
|
2
|
+
module Holidays
|
3
|
+
# This file is generated by the Ruby Holiday gem.
|
4
|
+
#
|
5
|
+
# Definitions loaded: data/it.yaml
|
6
|
+
#
|
7
|
+
# To use the definitions in this file, load them right after you load the
|
8
|
+
# Holiday gem:
|
9
|
+
#
|
10
|
+
# require 'holidays'
|
11
|
+
# require 'holidays/it'
|
12
|
+
#
|
13
|
+
# More definitions are available at http://code.dunae.ca/holidays.
|
14
|
+
module IT # :nodoc:
|
15
|
+
DEFINED_REGIONS = [:it]
|
16
|
+
|
17
|
+
HOLIDAYS_BY_MONTH = {
|
18
|
+
0 => [{:function => lambda { |year| Holidays.easter(year) }, :function_id => "easter(year)", :name => "Pasqua", :regions => [:it]},
|
19
|
+
{:function => lambda { |year| Holidays.easter(year)+1 }, :function_id => "easter(year)+1", :name => "Lunedì dell'Angelo", :regions => [:it]}],
|
20
|
+
1 => [{:mday => 1, :name => "Capodanno", :regions => [:it]},
|
21
|
+
{:mday => 6, :name => "Epifania", :regions => [:it]}],
|
22
|
+
4 => [{:mday => 25, :name => "Festa della Liberazione", :regions => [:it]}],
|
23
|
+
5 => [{:mday => 1, :name => "Festa dei Lavoratori", :regions => [:it]}],
|
24
|
+
6 => [{:mday => 2, :name => "Festa della Repubblica", :regions => [:it]}],
|
25
|
+
8 => [{:mday => 15, :name => "Assunzione", :regions => [:it]}],
|
26
|
+
11 => [{:mday => 1, :name => "Ognissanti", :regions => [:it]}],
|
27
|
+
12 => [{:mday => 8, :name => "Immacolata Concezione", :regions => [:it]},
|
28
|
+
{:mday => 25, :name => "Natale", :regions => [:it]},
|
29
|
+
{:mday => 26, :name => "Santo Stefano", :regions => [:it]}]
|
30
|
+
}
|
31
|
+
end
|
32
|
+
|
33
|
+
|
34
|
+
end
|
35
|
+
|
36
|
+
Holidays.merge_defs(Holidays::IT::DEFINED_REGIONS, Holidays::IT::HOLIDAYS_BY_MONTH)
|
data/lib/holidays/mx.rb
CHANGED
@@ -1,51 +1,52 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
#
|
4
|
-
#
|
5
|
-
#
|
6
|
-
#
|
7
|
-
#
|
8
|
-
#
|
9
|
-
#
|
10
|
-
# require 'holidays
|
11
|
-
#
|
12
|
-
#
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
{:mday =>
|
20
|
-
|
21
|
-
{:mday =>
|
22
|
-
{:
|
23
|
-
|
24
|
-
{:mday =>
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
{:mday =>
|
31
|
-
{:mday =>
|
32
|
-
{:mday =>
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
{:
|
42
|
-
|
43
|
-
|
44
|
-
{:mday =>
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
1
|
+
# encoding: utf-8
|
2
|
+
module Holidays
|
3
|
+
# This file is generated by the Ruby Holiday gem.
|
4
|
+
#
|
5
|
+
# Definitions loaded: data/mx.yaml, data/north_america_informal.yaml
|
6
|
+
#
|
7
|
+
# To use the definitions in this file, load them right after you load the
|
8
|
+
# Holiday gem:
|
9
|
+
#
|
10
|
+
# require 'holidays'
|
11
|
+
# require 'holidays/mx'
|
12
|
+
#
|
13
|
+
# More definitions are available at http://code.dunae.ca/holidays.
|
14
|
+
module MX # :nodoc:
|
15
|
+
DEFINED_REGIONS = [:mx, :mx_pue, :us, :ca]
|
16
|
+
|
17
|
+
HOLIDAYS_BY_MONTH = {
|
18
|
+
1 => [{:mday => 1, :name => "Año nuevo", :regions => [:mx]},
|
19
|
+
{:mday => 6, :name => "Dia de los Santos Reyes", :regions => [:mx]}],
|
20
|
+
2 => [{:wday => 1, :week => 1, :name => "Día de la Constitución", :regions => [:mx]},
|
21
|
+
{:mday => 2, :type => :informal, :name => "Groundhog Day", :regions => [:us, :ca]},
|
22
|
+
{:mday => 14, :type => :informal, :name => "Valentine's Day", :regions => [:us, :ca]}],
|
23
|
+
3 => [{:wday => 1, :week => 3, :name => "Natalicio de Benito Juárez", :regions => [:mx]},
|
24
|
+
{:mday => 17, :type => :informal, :name => "St. Patrick's Day", :regions => [:us, :ca]}],
|
25
|
+
4 => [{:mday => 30, :type => :informal, :name => "Día del Niño", :regions => [:mx]},
|
26
|
+
{:mday => 1, :type => :informal, :name => "April Fool's Day", :regions => [:us, :ca]},
|
27
|
+
{:mday => 22, :type => :informal, :name => "Earth Day", :regions => [:us, :ca]}],
|
28
|
+
5 => [{:mday => 1, :name => "Día del Trabajo", :regions => [:mx]},
|
29
|
+
{:mday => 5, :type => :informal, :name => "Cinco de Mayo", :regions => [:mx]},
|
30
|
+
{:mday => 5, :name => "La Batalla de Puebla", :regions => [:mx_pue]},
|
31
|
+
{:mday => 10, :type => :informal, :name => "Día de la Madre", :regions => [:mx]},
|
32
|
+
{:mday => 15, :type => :informal, :name => "Día del Maestro", :regions => [:mx]},
|
33
|
+
{:wday => 0, :week => 3, :type => :informal, :name => "Father's Day", :regions => [:us, :ca]}],
|
34
|
+
6 => [{:wday => 0, :week => 3, :type => :informal, :name => "Día del Padre", :regions => [:mx]}],
|
35
|
+
9 => [{:mday => 15, :name => "Grito de Dolores", :regions => [:mx]},
|
36
|
+
{:mday => 16, :name => "Día de la Independencia", :regions => [:mx]}],
|
37
|
+
10 => [{:mday => 12, :type => :informal, :name => "Día de la Raza", :regions => [:mx]},
|
38
|
+
{:mday => 31, :type => :informal, :name => "Halloween", :regions => [:us, :ca]}],
|
39
|
+
11 => [{:mday => 1, :type => :informal, :name => "Todos los Santos", :regions => [:mx]},
|
40
|
+
{:mday => 2, :type => :informal, :name => "Los Fieles Difuntos", :regions => [:mx]},
|
41
|
+
{:wday => 1, :week => 3, :name => "Día de la Revolución", :regions => [:mx]}],
|
42
|
+
12 => [{:mday => 12, :type => :informal, :name => "Día de la Virgen de Guadalupe", :regions => [:mx]},
|
43
|
+
{:mday => 24, :type => :informal, :name => "Nochebuena", :regions => [:mx]},
|
44
|
+
{:mday => 25, :name => "Navidad", :regions => [:mx]},
|
45
|
+
{:mday => 28, :name => "Los Santos Inocentes", :regions => [:mx]}]
|
46
|
+
}
|
47
|
+
end
|
48
|
+
|
49
|
+
|
50
|
+
end
|
51
|
+
|
52
|
+
Holidays.merge_defs(Holidays::MX::DEFINED_REGIONS, Holidays::MX::HOLIDAYS_BY_MONTH)
|