holidays 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/lib/holidays/fi.rb CHANGED
@@ -15,16 +15,16 @@ module Holidays
15
15
  DEFINED_REGIONS = [:fi]
16
16
 
17
17
  HOLIDAYS_BY_MONTH = {
18
+ 5 => [{:mday => 1, :name => "Vappu", :regions => [:fi]}],
18
19
  0 => [{:function => lambda { |year| Holidays.easter(year)-2 }, :function_id => "easter(year)-2", :name => "Pitkäperjantai", :regions => [:fi]},
19
20
  {:function => lambda { |year| Holidays.easter(year) }, :function_id => "easter(year)", :name => "Pääsiäispäivä", :regions => [:fi]},
20
21
  {:function => lambda { |year| Holidays.easter(year)+1 }, :function_id => "easter(year)+1", :name => "2. Pääsiäispäivä", :regions => [:fi]},
21
22
  {:function => lambda { |year| Holidays.easter(year)+39 }, :function_id => "easter(year)+39", :name => "Helatorstai", :regions => [:fi]},
22
23
  {:function => lambda { |year| Holidays.easter(year)+49 }, :function_id => "easter(year)+49", :name => "Helluntaipäivä", :regions => [:fi]},
23
24
  {:function => lambda { |year| Holidays.fi_pyhainpaiva(year) }, :function_id => "fi_pyhainpaiva(year)", :name => "Pyhäinpäivä", :regions => [:fi]}],
25
+ 6 => [{:function => lambda { |year| Holidays.fi_juhannuspaiva(year) }, :function_id => "fi_juhannuspaiva(year)", :name => "Juhannuspäivä", :regions => [:fi]}],
24
26
  1 => [{:mday => 1, :name => "Uudenvuodenpäivä", :regions => [:fi]},
25
27
  {:mday => 6, :name => "Loppiainen", :regions => [:fi]}],
26
- 5 => [{:mday => 1, :name => "Vappu", :regions => [:fi]}],
27
- 6 => [{:function => lambda { |year| Holidays.fi_juhannuspaiva(year) }, :function_id => "fi_juhannuspaiva(year)", :name => "Juhannuspäivä", :regions => [:fi]}],
28
28
  12 => [{:mday => 6, :name => "Itsenäisyyspäivä", :regions => [:fi]},
29
29
  {:mday => 24, :name => "Jouluaatto", :regions => [:fi]},
30
30
  {:mday => 25, :name => "Joulupäivä", :regions => [:fi]},
@@ -32,17 +32,17 @@ module Holidays
32
32
  }
33
33
  end
34
34
 
35
- # Finland: Mid-summer (Saturday between June 20–26)
36
- def self.fi_juhannuspaiva(year)
37
- date = Date.civil(year,6,20)
35
+ # Finland: All Saint's Day (Saturday between Oct 31 and Nov 6)
36
+ def self.fi_pyhainpaiva(year)
37
+ date = Date.civil(year,10,31)
38
38
  date += (6 - date.wday)
39
39
  date
40
40
  end
41
41
 
42
42
 
43
- # Finland: All Saint's Day (Saturday between Oct 31 and Nov 6)
44
- def self.fi_pyhainpaiva(year)
45
- date = Date.civil(year,10,31)
43
+ # Finland: Mid-summer (Saturday between June 20–26)
44
+ def self.fi_juhannuspaiva(year)
45
+ date = Date.civil(year,6,20)
46
46
  date += (6 - date.wday)
47
47
  date
48
48
  end
data/lib/holidays/fr.rb CHANGED
@@ -15,19 +15,19 @@ module Holidays
15
15
  DEFINED_REGIONS = [:fr]
16
16
 
17
17
  HOLIDAYS_BY_MONTH = {
18
+ 5 => [{:mday => 1, :name => "Fête du travail", :regions => [:fr]},
19
+ {:mday => 8, :name => "Victoire 1945", :regions => [:fr]}],
18
20
  0 => [{:function => lambda { |year| Holidays.easter(year) }, :function_id => "easter(year)", :name => "Pâques", :regions => [:fr]},
19
21
  {:function => lambda { |year| Holidays.easter(year)+1 }, :function_id => "easter(year)+1", :name => "Lundi de Pâques", :regions => [:fr]},
20
22
  {:function => lambda { |year| Holidays.easter(year)+39 }, :function_id => "easter(year)+39", :name => "Ascension", :regions => [:fr]},
21
23
  {:function => lambda { |year| Holidays.easter(year)+49 }, :function_id => "easter(year)+49", :name => "Pentecôte", :regions => [:fr]},
22
24
  {: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
25
  11 => [{:mday => 1, :name => "Toussaint", :regions => [:fr]},
29
26
  {:mday => 11, :name => "Armistice 1918", :regions => [:fr]}],
30
- 12 => [{:mday => 25, :name => "Nöel", :regions => [:fr]}]
27
+ 1 => [{:mday => 1, :name => "Jour de l'an", :regions => [:fr]}],
28
+ 12 => [{:mday => 25, :name => "Nöel", :regions => [:fr]}],
29
+ 7 => [{:mday => 14, :name => "Fête nationale", :regions => [:fr]}],
30
+ 8 => [{:mday => 15, :name => "Assomption", :regions => [:fr]}]
31
31
  }
32
32
  end
33
33
 
data/lib/holidays/gb.rb CHANGED
@@ -12,26 +12,26 @@ module Holidays
12
12
  #
13
13
  # More definitions are available at http://code.dunae.ca/holidays.
14
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]
15
+ DEFINED_REGIONS = [:gb, :je, :gb_jsy, :gg, :gb_gsy, :gb_eng, :gb_wls, :gb_eaw, :gb_nir, :gb_sct, :im, :gb_iom, :gb_con]
16
16
 
17
17
  HOLIDAYS_BY_MONTH = {
18
+ 5 => [{:wday => 1, :week => 1, :name => "May Day", :regions => [:gb]},
19
+ {:mday => 9, :name => "Liberation Day", :regions => [:je, :gb_jsy, :gg, :gb_gsy]},
20
+ {:wday => 1, :week => -1, :name => "Bank Holiday", :regions => [:gb]}],
18
21
  0 => [{:function => lambda { |year| Holidays.easter(year)-2 }, :function_id => "easter(year)-2", :name => "Good Friday", :regions => [:gb]},
19
22
  {:function => lambda { |year| Holidays.easter(year) }, :function_id => "easter(year)", :name => "Easter Sunday", :regions => [:gb]},
20
23
  {:function => lambda { |year| Holidays.easter(year)+1 }, :function_id => "easter(year)+1", :name => "Easter Monday", :regions => [:gb_eng, :gb_wls, :gb_eaw, :gb_nir]}],
24
+ 11 => [{:mday => 5, :type => :informal, :name => "Guy Fawkes Day", :regions => [:gb]}],
21
25
  1 => [{:mday => 1, :name => "New Year's Day", :regions => [:gb]},
22
26
  {: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]}],
27
+ 12 => [{:mday => 25, :observed => lambda { |date| Holidays.to_monday_if_weekend(date) }, :observed_id => "to_monday_if_weekend", :name => "Christmas Day", :regions => [:gb]},
28
+ {:mday => 26, :observed => lambda { |date| Holidays.to_weekday_if_boxing_weekend(date) }, :observed_id => "to_weekday_if_boxing_weekend", :name => "Boxing Day", :regions => [:gb]}],
28
29
  7 => [{:mday => 5, :name => "Tynwald Day", :regions => [:im, :gb_iom]},
29
30
  {:mday => 12, :name => "Battle of the Boyne", :regions => [:gb_nir]}],
30
31
  8 => [{:wday => 1, :week => 1, :name => "Bank Holiday", :regions => [:gb_sct]},
31
32
  {: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]}]
33
+ 3 => [{:mday => 5, :name => "St. Piran's Day", :regions => [:gb_con]},
34
+ {:mday => 17, :name => "St. Patrick's Day", :regions => [:gb_nir]}]
35
35
  }
36
36
  end
37
37
 
data/lib/holidays/ie.rb CHANGED
@@ -15,15 +15,15 @@ module Holidays
15
15
  DEFINED_REGIONS = [:ie]
16
16
 
17
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
18
  5 => [{:wday => 1, :week => 1, :name => "May Day", :regions => [:ie]}],
19
+ 0 => [{:function => lambda { |year| Holidays.easter(year)+1 }, :function_id => "easter(year)+1", :name => "Easter Monday", :regions => [:ie]}],
22
20
  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]}],
21
+ 1 => [{:mday => 1, :name => "New Year's Day", :regions => [:ie]}],
25
22
  12 => [{:mday => 25, :name => "Christmas Day", :regions => [:ie]},
26
- {:mday => 26, :name => "St. Stephen's Day", :regions => [:ie]}]
23
+ {:mday => 26, :name => "St. Stephen's Day", :regions => [:ie]}],
24
+ 8 => [{:wday => 1, :week => 1, :name => "Bank Holiday", :regions => [:ie]}],
25
+ 3 => [{:mday => 17, :name => "St. Patrick's Day", :regions => [:ie]}],
26
+ 10 => [{:wday => 1, :week => -1, :name => "Bank Holiday", :regions => [:ie]}]
27
27
  }
28
28
  end
29
29
 
data/lib/holidays/is.rb CHANGED
@@ -15,6 +15,8 @@ module Holidays
15
15
  DEFINED_REGIONS = [:is]
16
16
 
17
17
  HOLIDAYS_BY_MONTH = {
18
+ 5 => [{:mday => 1, :name => "Verkalýðsdagurinn", :regions => [:is]},
19
+ {:mday => 13, :name => "Mæðradagurinn", :regions => [:is]}],
18
20
  0 => [{:function => lambda { |year| Holidays.easter(year)-48 }, :function_id => "easter(year)-48", :name => "Bolludagur", :regions => [:is]},
19
21
  {:function => lambda { |year| Holidays.easter(year)-47 }, :function_id => "easter(year)-47", :name => "Sprengidagur", :regions => [:is]},
20
22
  {:function => lambda { |year| Holidays.easter(year)-46 }, :function_id => "easter(year)-46", :name => "Öskudagur", :regions => [:is]},
@@ -26,21 +28,19 @@ module Holidays
26
28
  {:function => lambda { |year| Holidays.easter(year)+39 }, :function_id => "easter(year)+39", :name => "Uppstigningardagur", :regions => [:is]},
27
29
  {:function => lambda { |year| Holidays.easter(year)+49 }, :function_id => "easter(year)+49", :name => "Hvítasunnudagur", :regions => [:is]},
28
30
  {:function => lambda { |year| Holidays.easter(year)+50 }, :function_id => "easter(year)+50", :name => "Annar í hvítasunnu", :regions => [:is]}],
31
+ 11 => [{:mday => 16, :name => "Dagur íslenskrar tungu", :regions => [:is]}],
32
+ 6 => [{:mday => 3, :type => :informal, :name => "Sjómannadagurinn", :regions => [:is]},
33
+ {:mday => 17, :name => "Lýðveldisdagurinn", :regions => [:is]}],
29
34
  1 => [{:mday => 1, :name => "Nýársdagur", :regions => [:is]},
30
35
  {:mday => 6, :name => "Þrettándinn", :regions => [:is]},
31
36
  {: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
37
  12 => [{:mday => 24, :name => "Jól", :regions => [:is]},
41
38
  {:mday => 25, :name => "Jól", :regions => [:is]},
42
39
  {:mday => 26, :name => "Jól", :regions => [:is]},
43
- {:mday => 31, :name => "Gamlárskvöld", :regions => [:is]}]
40
+ {:mday => 31, :name => "Gamlárskvöld", :regions => [:is]}],
41
+ 2 => [{:mday => 18, :type => :informal, :name => "Konudagur", :regions => [:is]}],
42
+ 8 => [{:wday => 1, :week => 1, :name => "Frídagur verslunarmanna", :regions => [:is]}],
43
+ 4 => [{:function => lambda { |year| Holidays.is_sumardagurinn_fyrsti(year) }, :function_id => "is_sumardagurinn_fyrsti(year)", :name => "Sumardagurinn fyrsti", :regions => [:is]}]
44
44
  }
45
45
  end
46
46
 
data/lib/holidays/it.rb CHANGED
@@ -15,18 +15,18 @@ module Holidays
15
15
  DEFINED_REGIONS = [:it]
16
16
 
17
17
  HOLIDAYS_BY_MONTH = {
18
+ 5 => [{:mday => 1, :name => "Festa dei Lavoratori", :regions => [:it]}],
18
19
  0 => [{:function => lambda { |year| Holidays.easter(year) }, :function_id => "easter(year)", :name => "Pasqua", :regions => [:it]},
19
20
  {:function => lambda { |year| Holidays.easter(year)+1 }, :function_id => "easter(year)+1", :name => "Lunedì dell'Angelo", :regions => [:it]}],
21
+ 11 => [{:mday => 1, :name => "Ognissanti", :regions => [:it]}],
22
+ 6 => [{:mday => 2, :name => "Festa della Repubblica", :regions => [:it]}],
20
23
  1 => [{:mday => 1, :name => "Capodanno", :regions => [:it]},
21
24
  {: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
25
  12 => [{:mday => 8, :name => "Immacolata Concezione", :regions => [:it]},
28
26
  {:mday => 25, :name => "Natale", :regions => [:it]},
29
- {:mday => 26, :name => "Santo Stefano", :regions => [:it]}]
27
+ {:mday => 26, :name => "Santo Stefano", :regions => [:it]}],
28
+ 8 => [{:mday => 15, :name => "Assunzione", :regions => [:it]}],
29
+ 4 => [{:mday => 25, :name => "Festa della Liberazione", :regions => [:it]}]
30
30
  }
31
31
  end
32
32
 
data/lib/holidays/jp.rb CHANGED
@@ -15,54 +15,45 @@ module Holidays
15
15
  DEFINED_REGIONS = [:jp]
16
16
 
17
17
  HOLIDAYS_BY_MONTH = {
18
- 1 => [{:mday => 1, :name => "元日", :regions => [:jp]},
19
- {:wday => 1, :week => 2, :name => "成人の日", :regions => [:jp]}],
20
- 2 => [{:mday => 11, :name => "建国記念日", :regions => [:jp]},
21
- {:function => lambda { |year| Holidays.jp_substitute_holiday(year, 2, 11) }, :function_id => "jp_substitute_holiday(year, 2, 11)", :name => "振替休日", :regions => [:jp]}],
22
- 3 => [{:function => lambda { |year| Holidays.jp_vernal_equinox_day(year) }, :function_id => "jp_vernal_equinox_day(year)", :name => "春分の日", :regions => [:jp]},
23
- {:function => lambda { |year| Holidays.jp_substitute_holiday(Holidays.jp_vernal_equinox_day(year)) }, :function_id => "jp_substitute_holiday(Holidays.jp_vernal_equinox_day(year))", :name => "振替休日", :regions => [:jp]}],
24
- 4 => [{:mday => 29, :name => "昭和の日", :regions => [:jp]},
25
- {:function => lambda { |year| Holidays.jp_substitute_holiday(year, 4, 29) }, :function_id => "jp_substitute_holiday(year, 4, 29)", :name => "振替休日", :regions => [:jp]}],
26
18
  5 => [{:mday => 3, :name => "憲法記念日", :regions => [:jp]},
27
19
  {:mday => 4, :name => "みどりの日", :regions => [:jp]},
28
20
  {:mday => 5, :name => "こどもの日", :regions => [:jp]},
29
21
  {:function => lambda { |year| Holidays.jp_substitute_holiday(year, 5, 3) }, :function_id => "jp_substitute_holiday(year, 5, 3)", :name => "振替休日", :regions => [:jp]},
30
22
  {:function => lambda { |year| Holidays.jp_substitute_holiday(year, 5, 5) }, :function_id => "jp_substitute_holiday(year, 5, 5)", :name => "振替休日", :regions => [:jp]}],
23
+ 11 => [{:mday => 3, :name => "文化の日", :regions => [:jp]},
24
+ {:function => lambda { |year| Holidays.jp_substitute_holiday(year, 11, 3) }, :function_id => "jp_substitute_holiday(year, 11, 3)", :name => "振替休日", :regions => [:jp]},
25
+ {:mday => 23, :name => "勤労感謝の日", :regions => [:jp]},
26
+ {:function => lambda { |year| Holidays.jp_substitute_holiday(year, 11, 23) }, :function_id => "jp_substitute_holiday(year, 11, 23)", :name => "振替休日", :regions => [:jp]}],
27
+ 1 => [{:mday => 1, :name => "元日", :regions => [:jp]},
28
+ {:wday => 1, :week => 2, :name => "成人の日", :regions => [:jp]}],
29
+ 12 => [{:mday => 23, :name => "天皇誕生日", :regions => [:jp]},
30
+ {:function => lambda { |year| Holidays.jp_substitute_holiday(year, 12, 23) }, :function_id => "jp_substitute_holiday(year, 12, 23)", :name => "振替休日", :regions => [:jp]}],
31
31
  7 => [{:wday => 1, :week => 3, :name => "海の日", :regions => [:jp]},
32
32
  {:function => lambda { |year| Holidays.jp_substitute_holiday(year, 7, Date.calculate_mday(year, 7, 3, 1)) }, :function_id => "jp_substitute_holiday(year, 7, Date.calculate_mday(year, 7, 3, 1))", :name => "振替休日", :regions => [:jp]}],
33
+ 2 => [{:mday => 11, :name => "建国記念日", :regions => [:jp]},
34
+ {:function => lambda { |year| Holidays.jp_substitute_holiday(year, 2, 11) }, :function_id => "jp_substitute_holiday(year, 2, 11)", :name => "振替休日", :regions => [:jp]}],
35
+ 3 => [{:function => lambda { |year| Holidays.jp_vernal_equinox_day(year) }, :function_id => "jp_vernal_equinox_day(year)", :name => "春分の日", :regions => [:jp]},
36
+ {:function => lambda { |year| Holidays.jp_substitute_holiday(Holidays.jp_vernal_equinox_day(year)) }, :function_id => "jp_substitute_holiday(Holidays.jp_vernal_equinox_day(year))", :name => "振替休日", :regions => [:jp]}],
33
37
  9 => [{:wday => 1, :week => 3, :name => "敬老の日", :regions => [:jp]},
34
38
  {:function => lambda { |year| Holidays.jp_substitute_holiday(year, 9, Date.calculate_mday(year, 9, 3, 1)) }, :function_id => "jp_substitute_holiday(year, 9, Date.calculate_mday(year, 9, 3, 1))", :name => "振替休日", :regions => [:jp]},
35
39
  {:function => lambda { |year| Holidays.jp_citizons_holiday(year) }, :function_id => "jp_citizons_holiday(year)", :name => "国民の休日", :regions => [:jp]},
36
40
  {:function => lambda { |year| Holidays.jp_national_culture_day(year) }, :function_id => "jp_national_culture_day(year)", :name => "秋分の日", :regions => [:jp]},
37
41
  {:function => lambda { |year| Holidays.jp_substitute_holiday(Holidays.jp_national_culture_day(year)) }, :function_id => "jp_substitute_holiday(Holidays.jp_national_culture_day(year))", :name => "振替休日", :regions => [:jp]}],
42
+ 4 => [{:mday => 29, :name => "昭和の日", :regions => [:jp]},
43
+ {:function => lambda { |year| Holidays.jp_substitute_holiday(year, 4, 29) }, :function_id => "jp_substitute_holiday(year, 4, 29)", :name => "振替休日", :regions => [:jp]}],
38
44
  10 => [{:wday => 1, :week => 2, :name => "体育の日", :regions => [:jp]},
39
- {:function => lambda { |year| Holidays.jp_substitute_holiday(year, 10, Date.calculate_mday(year, 10, 2, 1)) }, :function_id => "jp_substitute_holiday(year, 10, Date.calculate_mday(year, 10, 2, 1))", :name => "振替休日", :regions => [:jp]}],
40
- 11 => [{:mday => 3, :name => "文化の日", :regions => [:jp]},
41
- {:function => lambda { |year| Holidays.jp_substitute_holiday(year, 11, 3) }, :function_id => "jp_substitute_holiday(year, 11, 3)", :name => "振替休日", :regions => [:jp]},
42
- {:mday => 23, :name => "勤労感謝の日", :regions => [:jp]},
43
- {:function => lambda { |year| Holidays.jp_substitute_holiday(year, 11, 23) }, :function_id => "jp_substitute_holiday(year, 11, 23)", :name => "振替休日", :regions => [:jp]}],
44
- 12 => [{:mday => 23, :name => "天皇誕生日", :regions => [:jp]},
45
- {:function => lambda { |year| Holidays.jp_substitute_holiday(year, 12, 23) }, :function_id => "jp_substitute_holiday(year, 12, 23)", :name => "振替休日", :regions => [:jp]}]
45
+ {:function => lambda { |year| Holidays.jp_substitute_holiday(year, 10, Date.calculate_mday(year, 10, 2, 1)) }, :function_id => "jp_substitute_holiday(year, 10, Date.calculate_mday(year, 10, 2, 1))", :name => "振替休日", :regions => [:jp]}]
46
46
  }
47
47
  end
48
48
 
49
- def self.jp_vernal_equinox_day(year)
50
- day =
51
- case year
52
- when 1851..1899
53
- 19.8277
54
- when 1900..1979
55
- 20.8357
56
- when 1980..2099
57
- 20.8431
58
- when 2100..2150
59
- 21.8510
60
- else
61
- raise IndexError.new("Out of range")
62
- end
63
- day += 0.242194 * (year - 1980) - ((year - 1980)/4).floor
64
- day = day.floor
65
- Date.civil(year, 3, day)
49
+ def self.jp_citizons_holiday(year)
50
+ year < 2003 and return nil
51
+ ncd = Holidays.jp_national_culture_day(year)
52
+ if ncd.wday == 3
53
+ ncd - 1
54
+ else
55
+ nil
56
+ end
66
57
  end
67
58
 
68
59
 
@@ -86,23 +77,32 @@ def self.jp_national_culture_day(year)
86
77
  end
87
78
 
88
79
 
89
- def self.jp_citizons_holiday(year)
90
- year < 2003 and return nil
91
- ncd = Holidays.jp_national_culture_day(year)
92
- if ncd.wday == 3
93
- ncd - 1
94
- else
95
- nil
96
- end
97
- end
98
-
99
-
100
80
  def self.jp_substitute_holiday(*date)
101
81
  date = date[0].kind_of?(Date) ? date.first : Date.civil(*date)
102
82
  date.wday == 0 ? date+1 : nil
103
83
  end
104
84
 
105
85
 
86
+ def self.jp_vernal_equinox_day(year)
87
+ day =
88
+ case year
89
+ when 1851..1899
90
+ 19.8277
91
+ when 1900..1979
92
+ 20.8357
93
+ when 1980..2099
94
+ 20.8431
95
+ when 2100..2150
96
+ 21.8510
97
+ else
98
+ raise IndexError.new("Out of range")
99
+ end
100
+ day += 0.242194 * (year - 1980) - ((year - 1980)/4).floor
101
+ day = day.floor
102
+ Date.civil(year, 3, day)
103
+ end
104
+
105
+
106
106
 
107
107
  end
108
108
 
data/lib/holidays/mx.rb CHANGED
@@ -15,34 +15,34 @@ module Holidays
15
15
  DEFINED_REGIONS = [:mx, :mx_pue, :us, :ca]
16
16
 
17
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
18
  5 => [{:mday => 1, :name => "Día del Trabajo", :regions => [:mx]},
29
19
  {:mday => 5, :type => :informal, :name => "Cinco de Mayo", :regions => [:mx]},
30
20
  {:mday => 5, :name => "La Batalla de Puebla", :regions => [:mx_pue]},
31
21
  {:mday => 10, :type => :informal, :name => "Día de la Madre", :regions => [:mx]},
32
22
  {:mday => 15, :type => :informal, :name => "Día del Maestro", :regions => [:mx]},
33
23
  {: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
24
  11 => [{:mday => 1, :type => :informal, :name => "Todos los Santos", :regions => [:mx]},
40
25
  {:mday => 2, :type => :informal, :name => "Los Fieles Difuntos", :regions => [:mx]},
41
26
  {:wday => 1, :week => 3, :name => "Día de la Revolución", :regions => [:mx]}],
27
+ 6 => [{:wday => 0, :week => 3, :type => :informal, :name => "Día del Padre", :regions => [:mx]}],
28
+ 1 => [{:mday => 1, :name => "Año nuevo", :regions => [:mx]},
29
+ {:mday => 6, :name => "Dia de los Santos Reyes", :regions => [:mx]}],
42
30
  12 => [{:mday => 12, :type => :informal, :name => "Día de la Virgen de Guadalupe", :regions => [:mx]},
43
31
  {:mday => 24, :type => :informal, :name => "Nochebuena", :regions => [:mx]},
44
32
  {:mday => 25, :name => "Navidad", :regions => [:mx]},
45
- {:mday => 28, :name => "Los Santos Inocentes", :regions => [:mx]}]
33
+ {:mday => 28, :name => "Los Santos Inocentes", :regions => [:mx]}],
34
+ 2 => [{:wday => 1, :week => 1, :name => "Día de la Constitución", :regions => [:mx]},
35
+ {:mday => 2, :type => :informal, :name => "Groundhog Day", :regions => [:us, :ca]},
36
+ {:mday => 14, :type => :informal, :name => "Valentine's Day", :regions => [:us, :ca]}],
37
+ 3 => [{:wday => 1, :week => 3, :name => "Natalicio de Benito Juárez", :regions => [:mx]},
38
+ {:mday => 17, :type => :informal, :name => "St. Patrick's Day", :regions => [:us, :ca]}],
39
+ 9 => [{:mday => 15, :name => "Grito de Dolores", :regions => [:mx]},
40
+ {:mday => 16, :name => "Día de la Independencia", :regions => [:mx]}],
41
+ 4 => [{:mday => 30, :type => :informal, :name => "Día del Niño", :regions => [:mx]},
42
+ {:mday => 1, :type => :informal, :name => "April Fool's Day", :regions => [:us, :ca]},
43
+ {:mday => 22, :type => :informal, :name => "Earth Day", :regions => [:us, :ca]}],
44
+ 10 => [{:mday => 12, :type => :informal, :name => "Día de la Raza", :regions => [:mx]},
45
+ {:mday => 31, :type => :informal, :name => "Halloween", :regions => [:us, :ca]}]
46
46
  }
47
47
  end
48
48
 
data/lib/holidays/nl.rb CHANGED
@@ -15,6 +15,8 @@ module Holidays
15
15
  DEFINED_REGIONS = [:nl]
16
16
 
17
17
  HOLIDAYS_BY_MONTH = {
18
+ 5 => [{:mday => 4, :name => "Dodenherdenking", :regions => [:nl]},
19
+ {:mday => 5, :name => "Bevrijdingsdag", :regions => [:nl]}],
18
20
  0 => [{:function => lambda { |year| Holidays.easter(year)-2 }, :function_id => "easter(year)-2", :name => "Goede Vrijdag", :regions => [:nl]},
19
21
  {:function => lambda { |year| Holidays.easter(year) }, :function_id => "easter(year)", :name => "Pasen", :regions => [:nl]},
20
22
  {:function => lambda { |year| Holidays.easter(year)+1 }, :function_id => "easter(year)+1", :name => "Pasen", :regions => [:nl]},
@@ -22,12 +24,10 @@ module Holidays
22
24
  {:function => lambda { |year| Holidays.easter(year)+49 }, :function_id => "easter(year)+49", :name => "Pinksteren", :regions => [:nl]},
23
25
  {:function => lambda { |year| Holidays.easter(year)+50 }, :function_id => "easter(year)+50", :name => "Pinksteren", :regions => [:nl]}],
24
26
  1 => [{:mday => 1, :name => "Nieuwjaar", :regions => [:nl]}],
25
- 4 => [{:mday => 30, :name => "Koninginnedag", :regions => [:nl]}],
26
- 5 => [{:mday => 4, :name => "Dodenherdenking", :regions => [:nl]},
27
- {:mday => 5, :name => "Bevrijdingsdag", :regions => [:nl]}],
28
27
  12 => [{:mday => 5, :type => :informal, :name => "Sinterklaas", :regions => [:nl]},
29
28
  {:mday => 25, :name => "Kerstmis", :regions => [:nl]},
30
- {:mday => 26, :name => "Kerstmis", :regions => [:nl]}]
29
+ {:mday => 26, :name => "Kerstmis", :regions => [:nl]}],
30
+ 4 => [{:mday => 30, :name => "Koninginnedag", :regions => [:nl]}]
31
31
  }
32
32
  end
33
33
 
data/lib/holidays/no.rb CHANGED
@@ -15,6 +15,8 @@ module Holidays
15
15
  DEFINED_REGIONS = [:no]
16
16
 
17
17
  HOLIDAYS_BY_MONTH = {
18
+ 5 => [{:mday => 1, :name => "1. mai", :regions => [:no]},
19
+ {:mday => 17, :name => "17. mai", :regions => [:no]}],
18
20
  0 => [{:function => lambda { |year| Holidays.easter(year)-49 }, :function_id => "easter(year)-49", :type => :informal, :name => "Fastelavn", :regions => [:no]},
19
21
  {:function => lambda { |year| Holidays.easter(year)-7 }, :function_id => "easter(year)-7", :name => "Palmesøndag", :regions => [:no]},
20
22
  {:function => lambda { |year| Holidays.easter(year)-3 }, :function_id => "easter(year)-3", :name => "Skjærtorsdag", :regions => [:no]},
@@ -25,8 +27,6 @@ module Holidays
25
27
  {:function => lambda { |year| Holidays.easter(year)+49 }, :function_id => "easter(year)+49", :name => "1. pinsedag", :regions => [:no]},
26
28
  {:function => lambda { |year| Holidays.easter(year)+50 }, :function_id => "easter(year)+50", :name => "2. pinsedag", :regions => [:no]}],
27
29
  1 => [{:mday => 1, :name => "Nyttårsdag", :regions => [:no]}],
28
- 5 => [{:mday => 1, :name => "1. mai", :regions => [:no]},
29
- {:mday => 17, :name => "17. mai", :regions => [:no]}],
30
30
  12 => [{:mday => 24, :type => :informal, :name => "Julaften", :regions => [:no]},
31
31
  {:mday => 25, :name => "1. juledag", :regions => [:no]},
32
32
  {:mday => 26, :name => "2. juledag", :regions => [:no]},
@@ -12,28 +12,9 @@ module Holidays
12
12
  #
13
13
  # More definitions are available at http://code.dunae.ca/holidays.
14
14
  module North_America # :nodoc:
15
- DEFINED_REGIONS = [:ca, :ca_qc, :ca_ab, :ca_on, :ca_sk, :ca_mb, :ca_nf, :ca_nt, :ca_nu, :ca_bc, :ca_ns, :ca_yk, :mx, :mx_pue, :us, :us_dc]
15
+ DEFINED_REGIONS = [:ca, :ca_qc, :ca_nf, :ca_nt, :ca_nu, :ca_ab, :ca_on, :ca_sk, :ca_mb, :ca_bc, :ca_ns, :ca_yk, :mx, :mx_pue, :us, :us_dc]
16
16
 
17
17
  HOLIDAYS_BY_MONTH = {
18
- 0 => [{:function => lambda { |year| Holidays.easter(year)-2 }, :function_id => "easter(year)-2", :name => "Good Friday", :regions => [:ca]},
19
- {:function => lambda { |year| Holidays.easter(year)+1 }, :function_id => "easter(year)+1", :type => :informal, :name => "Easter Monday", :regions => [:ca]},
20
- {:function => lambda { |year| Holidays.easter(year)-2 }, :function_id => "easter(year)-2", :type => :informal, :name => "Good Friday", :regions => [:us]}],
21
- 1 => [{:mday => 1, :name => "New Year's Day", :regions => [:ca]},
22
- {:mday => 2, :name => "New Year's", :regions => [:ca_qc]},
23
- {:mday => 1, :name => "Año nuevo", :regions => [:mx]},
24
- {:mday => 6, :name => "Dia de los Santos Reyes", :regions => [:mx]},
25
- {:mday => 1, :observed => lambda { |date| Holidays.to_weekday_if_weekend(date) }, :observed_id => "to_weekday_if_weekend", :name => "New Year's Day", :regions => [:us]},
26
- {:wday => 1, :week => 3, :name => "Martin Luther King, Jr. Day", :regions => [:us]},
27
- {:function => lambda { |year| Holidays.us_inauguration_day(year) }, :function_id => "us_inauguration_day(year)", :name => "Inauguration Day", :regions => [:us_dc]}],
28
- 2 => [{:wday => 1, :week => 3, :name => "Family Day", :regions => [:ca_ab, :ca_on, :ca_sk]},
29
- {:wday => 1, :week => 3, :name => "Louis Riel Day", :regions => [:ca_mb]},
30
- {:wday => 1, :week => 1, :name => "Día de la Constitución", :regions => [:mx]},
31
- {:wday => 1, :week => 3, :name => "Presidents' Day", :regions => [:us]},
32
- {:mday => 2, :type => :informal, :name => "Groundhog Day", :regions => [:us, :ca]},
33
- {:mday => 14, :type => :informal, :name => "Valentine's Day", :regions => [:us, :ca]}],
34
- 3 => [{:mday => 23, :name => "St. George's Day", :regions => [:ca_nf]},
35
- {:wday => 1, :week => 3, :name => "Natalicio de Benito Juárez", :regions => [:mx]},
36
- {:mday => 17, :type => :informal, :name => "St. Patrick's Day", :regions => [:us, :ca]}],
37
18
  5 => [{:function => lambda { |year| Holidays.ca_victoria_day(year) }, :function_id => "ca_victoria_day(year)", :name => "Victoria Day", :regions => [:ca]},
38
19
  {:function => lambda { |year| Holidays.ca_victoria_day(year) }, :function_id => "ca_victoria_day(year)", :name => "National Patriotes Day", :regions => [:ca_qc]},
39
20
  {:mday => 1, :name => "Día del Trabajo", :regions => [:mx]},
@@ -43,44 +24,63 @@ module Holidays
43
24
  {:mday => 15, :type => :informal, :name => "Día del Maestro", :regions => [:mx]},
44
25
  {:wday => 1, :week => -1, :name => "Memorial Day", :regions => [:us]},
45
26
  {:wday => 0, :week => 3, :type => :informal, :name => "Father's Day", :regions => [:us, :ca]}],
27
+ 0 => [{:function => lambda { |year| Holidays.easter(year)-2 }, :function_id => "easter(year)-2", :name => "Good Friday", :regions => [:ca]},
28
+ {:function => lambda { |year| Holidays.easter(year)+1 }, :function_id => "easter(year)+1", :type => :informal, :name => "Easter Monday", :regions => [:ca]},
29
+ {:function => lambda { |year| Holidays.easter(year)-2 }, :function_id => "easter(year)-2", :type => :informal, :name => "Good Friday", :regions => [:us]}],
30
+ 11 => [{:mday => 11, :name => "Remembrance Day", :regions => [:ca]},
31
+ {:mday => 1, :type => :informal, :name => "Todos los Santos", :regions => [:mx]},
32
+ {:mday => 2, :type => :informal, :name => "Los Fieles Difuntos", :regions => [:mx]},
33
+ {:wday => 1, :week => 3, :name => "Día de la Revolución", :regions => [:mx]},
34
+ {:mday => 11, :observed => lambda { |date| Holidays.to_weekday_if_weekend(date) }, :observed_id => "to_weekday_if_weekend", :name => "Veterans Day", :regions => [:us]},
35
+ {:wday => 4, :week => 4, :name => "Thanksgiving", :regions => [:us]}],
46
36
  6 => [{:mday => 24, :name => "Discovery Day", :regions => [:ca_nf]},
47
37
  {:mday => 24, :name => "Fête Nationale", :regions => [:ca_qc]},
48
38
  {:mday => 21, :name => "National Aboriginal Day", :regions => [:ca_nt]},
49
39
  {:wday => 0, :week => 3, :type => :informal, :name => "Día del Padre", :regions => [:mx]}],
40
+ 1 => [{:mday => 1, :name => "New Year's Day", :regions => [:ca]},
41
+ {:mday => 2, :name => "New Year's", :regions => [:ca_qc]},
42
+ {:mday => 1, :name => "Año nuevo", :regions => [:mx]},
43
+ {:mday => 6, :name => "Dia de los Santos Reyes", :regions => [:mx]},
44
+ {:mday => 1, :observed => lambda { |date| Holidays.to_weekday_if_weekend(date) }, :observed_id => "to_weekday_if_weekend", :name => "New Year's Day", :regions => [:us]},
45
+ {:wday => 1, :week => 3, :name => "Martin Luther King, Jr. Day", :regions => [:us]},
46
+ {:function => lambda { |year| Holidays.us_inauguration_day(year) }, :function_id => "us_inauguration_day(year)", :name => "Inauguration Day", :regions => [:us_dc]}],
47
+ 12 => [{:mday => 25, :name => "Christmas Day", :regions => [:ca]},
48
+ {:mday => 26, :name => "Boxing Day", :regions => [:ca]},
49
+ {:mday => 12, :type => :informal, :name => "Día de la Virgen de Guadalupe", :regions => [:mx]},
50
+ {:mday => 24, :type => :informal, :name => "Nochebuena", :regions => [:mx]},
51
+ {:mday => 25, :name => "Navidad", :regions => [:mx]},
52
+ {:mday => 28, :name => "Los Santos Inocentes", :regions => [:mx]},
53
+ {:mday => 25, :observed => lambda { |date| Holidays.to_weekday_if_weekend(date) }, :observed_id => "to_weekday_if_weekend", :name => "Christmas Day", :regions => [:us]}],
50
54
  7 => [{:mday => 1, :observed => lambda { |date| Holidays.to_monday_if_sunday(date) }, :observed_id => "to_monday_if_sunday", :name => "Canada Day", :regions => [:ca]},
51
55
  {:mday => 12, :name => "Orangemen's Day", :regions => [:ca_nf]},
52
56
  {:mday => 9, :name => "Nunavut Day", :regions => [:ca_nu]},
53
57
  {:mday => 4, :observed => lambda { |date| Holidays.to_weekday_if_weekend(date) }, :observed_id => "to_weekday_if_weekend", :name => "Independence Day", :regions => [:us]}],
58
+ 2 => [{:wday => 1, :week => 3, :name => "Family Day", :regions => [:ca_ab, :ca_on, :ca_sk]},
59
+ {:wday => 1, :week => 3, :name => "Louis Riel Day", :regions => [:ca_mb]},
60
+ {:wday => 1, :week => 1, :name => "Día de la Constitución", :regions => [:mx]},
61
+ {:wday => 1, :week => 3, :name => "Presidents' Day", :regions => [:us]},
62
+ {:mday => 2, :type => :informal, :name => "Groundhog Day", :regions => [:us, :ca]},
63
+ {:mday => 14, :type => :informal, :name => "Valentine's Day", :regions => [:us, :ca]}],
54
64
  8 => [{:wday => 1, :week => 1, :name => "BC Day", :regions => [:ca_bc]},
55
65
  {:wday => 1, :week => 1, :name => "Saskatchewan Day", :regions => [:ca_sk]},
56
66
  {:wday => 1, :week => 1, :name => "Heritage Day", :regions => [:ca_ab]},
57
67
  {:wday => 1, :week => 1, :name => "Natal Day", :regions => [:ca_ns]},
58
68
  {:wday => 1, :week => 1, :name => "Civic Holiday", :regions => [:ca_on]},
59
69
  {:wday => 1, :week => 3, :name => "Discovery Day", :regions => [:ca_yk]}],
70
+ 3 => [{:mday => 23, :name => "St. George's Day", :regions => [:ca_nf]},
71
+ {:wday => 1, :week => 3, :name => "Natalicio de Benito Juárez", :regions => [:mx]},
72
+ {:mday => 17, :type => :informal, :name => "St. Patrick's Day", :regions => [:us, :ca]}],
60
73
  9 => [{:wday => 1, :week => 1, :name => "Labour Day", :regions => [:ca]},
61
74
  {:mday => 15, :name => "Grito de Dolores", :regions => [:mx]},
62
75
  {:mday => 16, :name => "Día de la Independencia", :regions => [:mx]},
63
76
  {:wday => 1, :week => 1, :name => "Labor Day", :regions => [:us]}],
77
+ 4 => [{:mday => 30, :type => :informal, :name => "Día del Niño", :regions => [:mx]},
78
+ {:mday => 1, :type => :informal, :name => "April Fool's Day", :regions => [:us, :ca]},
79
+ {:mday => 22, :type => :informal, :name => "Earth Day", :regions => [:us, :ca]}],
64
80
  10 => [{:wday => 1, :week => 2, :name => "Thanksgiving", :regions => [:ca]},
65
81
  {:mday => 12, :type => :informal, :name => "Día de la Raza", :regions => [:mx]},
66
82
  {:wday => 1, :week => 2, :name => "Columbus Day", :regions => [:us]},
67
- {:mday => 31, :type => :informal, :name => "Halloween", :regions => [:us, :ca]}],
68
- 11 => [{:mday => 11, :name => "Remembrance Day", :regions => [:ca]},
69
- {:mday => 1, :type => :informal, :name => "Todos los Santos", :regions => [:mx]},
70
- {:mday => 2, :type => :informal, :name => "Los Fieles Difuntos", :regions => [:mx]},
71
- {:wday => 1, :week => 3, :name => "Día de la Revolución", :regions => [:mx]},
72
- {:mday => 11, :observed => lambda { |date| Holidays.to_weekday_if_weekend(date) }, :observed_id => "to_weekday_if_weekend", :name => "Veterans Day", :regions => [:us]},
73
- {:wday => 4, :week => 4, :name => "Thanksgiving", :regions => [:us]}],
74
- 12 => [{:mday => 25, :name => "Christmas Day", :regions => [:ca]},
75
- {:mday => 26, :name => "Boxing Day", :regions => [:ca]},
76
- {:mday => 12, :type => :informal, :name => "Día de la Virgen de Guadalupe", :regions => [:mx]},
77
- {:mday => 24, :type => :informal, :name => "Nochebuena", :regions => [:mx]},
78
- {:mday => 25, :name => "Navidad", :regions => [:mx]},
79
- {:mday => 28, :name => "Los Santos Inocentes", :regions => [:mx]},
80
- {:mday => 25, :observed => lambda { |date| Holidays.to_weekday_if_weekend(date) }, :observed_id => "to_weekday_if_weekend", :name => "Christmas Day", :regions => [:us]}],
81
- 4 => [{:mday => 30, :type => :informal, :name => "Día del Niño", :regions => [:mx]},
82
- {:mday => 1, :type => :informal, :name => "April Fool's Day", :regions => [:us, :ca]},
83
- {:mday => 22, :type => :informal, :name => "Earth Day", :regions => [:us, :ca]}]
83
+ {:mday => 31, :type => :informal, :name => "Halloween", :regions => [:us, :ca]}]
84
84
  }
85
85
  end
86
86