holidays 0.9.3 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (86) hide show
  1. data/.gitignore +3 -0
  2. data/CHANGELOG +7 -0
  3. data/{README → README.rdoc} +36 -39
  4. data/data/SYNTAX +1 -1
  5. data/data/au.yaml +110 -105
  6. data/data/build_defs.rb +4 -3
  7. data/data/ca.yaml +140 -140
  8. data/data/cz.yaml +68 -0
  9. data/data/de.yaml +12 -14
  10. data/data/dk.yaml +1 -1
  11. data/data/es.yaml +1 -1
  12. data/data/fr.yaml +1 -1
  13. data/data/gb.yaml +1 -1
  14. data/data/ie.yaml +1 -1
  15. data/data/index.yaml +7 -2
  16. data/data/is.yaml +1 -1
  17. data/data/it.yaml +1 -1
  18. data/data/mx.yaml +1 -1
  19. data/data/nl.yaml +1 -1
  20. data/data/no.yaml +82 -0
  21. data/data/nyse.yaml +1 -1
  22. data/data/nz.yaml +141 -0
  23. data/data/pt.yaml +1 -1
  24. data/data/se.yaml +1 -1
  25. data/data/united_nations.yaml +188 -188
  26. data/data/ups.yaml +55 -55
  27. data/data/us.yaml +80 -80
  28. data/data/za.yaml +1 -1
  29. data/holidays.gemspec +155 -0
  30. data/lib/holidays.rb +424 -403
  31. data/lib/holidays/MANIFEST +28 -25
  32. data/lib/holidays/au.rb +43 -41
  33. data/lib/holidays/ca.rb +69 -68
  34. data/lib/holidays/cz.rb +36 -0
  35. data/lib/holidays/de.rb +51 -52
  36. data/lib/holidays/dk.rb +48 -47
  37. data/lib/holidays/es.rb +53 -52
  38. data/lib/holidays/europe.rb +236 -215
  39. data/lib/holidays/fr.rb +37 -36
  40. data/lib/holidays/gb.rb +41 -40
  41. data/lib/holidays/ie.rb +33 -32
  42. data/lib/holidays/is.rb +62 -61
  43. data/lib/holidays/it.rb +36 -35
  44. data/lib/holidays/mx.rb +52 -51
  45. data/lib/holidays/nl.rb +37 -36
  46. data/lib/holidays/no.rb +40 -0
  47. data/lib/holidays/north_america.rb +108 -107
  48. data/lib/holidays/nyse.rb +33 -32
  49. data/lib/holidays/nz.rb +69 -0
  50. data/lib/holidays/pt.rb +38 -52
  51. data/lib/holidays/scandinavia.rb +124 -114
  52. data/lib/holidays/se.rb +53 -52
  53. data/lib/holidays/united_nations.rb +25 -24
  54. data/lib/holidays/ups.rb +32 -31
  55. data/lib/holidays/us.rb +49 -48
  56. data/lib/holidays/za.rb +36 -35
  57. data/rakefile.rb +105 -113
  58. data/test/defs/test_defs_au.rb +36 -36
  59. data/test/defs/test_defs_ca.rb +29 -29
  60. data/test/defs/test_defs_cz.rb +26 -0
  61. data/test/defs/test_defs_de.rb +51 -46
  62. data/test/defs/test_defs_dk.rb +30 -30
  63. data/test/defs/test_defs_es.rb +57 -57
  64. data/test/defs/test_defs_europe.rb +280 -240
  65. data/test/defs/test_defs_fr.rb +26 -26
  66. data/test/defs/test_defs_gb.rb +36 -36
  67. data/test/defs/test_defs_ie.rb +21 -21
  68. data/test/defs/test_defs_is.rb +33 -33
  69. data/test/defs/test_defs_it.rb +25 -25
  70. data/test/defs/test_defs_mx.rb +22 -22
  71. data/test/defs/test_defs_nl.rb +24 -24
  72. data/test/defs/test_defs_no.rb +29 -0
  73. data/test/defs/test_defs_north_america.rb +54 -54
  74. data/test/defs/test_defs_nyse.rb +22 -22
  75. data/test/defs/test_defs_nz.rb +22 -0
  76. data/test/defs/test_defs_pt.rb +32 -32
  77. data/test/defs/test_defs_scandinavia.rb +94 -75
  78. data/test/defs/test_defs_se.rb +32 -32
  79. data/test/defs/test_defs_ups.rb +21 -21
  80. data/test/defs/test_defs_us.rb +23 -23
  81. data/test/defs/test_defs_za.rb +25 -25
  82. data/test/test_date.rb +123 -0
  83. data/test/test_helper.rb +22 -0
  84. data/test/test_holidays.rb +128 -0
  85. data/test/test_multiple_regions.rb +24 -0
  86. metadata +126 -73
@@ -1,25 +1,28 @@
1
- ==== Regional definitions
2
- The following definition files are included in this installation:
3
-
4
- * holidays/au
5
- * holidays/ca
6
- * holidays/de
7
- * holidays/dk
8
- * holidays/es
9
- * holidays/europe
10
- * holidays/fr
11
- * holidays/gb
12
- * holidays/ie
13
- * holidays/is
14
- * holidays/it
15
- * holidays/mx
16
- * holidays/nl
17
- * holidays/north_america
18
- * holidays/nyse
19
- * holidays/pt
20
- * holidays/scandinavia
21
- * holidays/se
22
- * holidays/united_nations
23
- * holidays/ups
24
- * holidays/us
25
- * holidays/za
1
+ ==== Regional definitions
2
+ The following definition files are included in this installation:
3
+
4
+ * holidays/nyse
5
+ * holidays/no
6
+ * holidays/es
7
+ * holidays/ie
8
+ * holidays/united_nations
9
+ * holidays/au
10
+ * holidays/mx
11
+ * holidays/za
12
+ * holidays/scandinavia
13
+ * holidays/ca
14
+ * holidays/us
15
+ * holidays/nl
16
+ * holidays/it
17
+ * holidays/de
18
+ * holidays/dk
19
+ * holidays/cz
20
+ * holidays/nz
21
+ * holidays/ups
22
+ * holidays/pt
23
+ * holidays/europe
24
+ * holidays/se
25
+ * holidays/north_america
26
+ * holidays/fr
27
+ * holidays/gb
28
+ * holidays/is
@@ -1,41 +1,43 @@
1
- module Holidays
2
- # This file is generated by the Ruby Holiday gem.
3
- #
4
- # Definitions loaded: data/au.yaml
5
- #
6
- # To use the definitions in this file, load them right after you load the
7
- # Holiday gem:
8
- #
9
- # require 'holidays'
10
- # require 'holidays/au'
11
- #
12
- # More definitions are available at http://code.dunae.ca/holidays.
13
- module AU # :nodoc:
14
- DEFINED_REGIONS = [:au_qld, :au_nt, :au, :au_tas, :au_wa, :au_act, :au_nsw, :au_sa, :au_vic]
15
-
16
- HOLIDAYS_BY_MONTH = {
17
- 5 => [{:wday => 1, :week => 1, :name => "Labour Day", :regions => [:au_qld]},
18
- {:wday => 1, :week => 1, :name => "May Day", :regions => [:au_nt]}],
19
- 0 => [{:function => lambda { |year| Holidays.easter(year)-2 }, :function_id => "easter(year)-2", :name => "Good Friday", :regions => [:au]},
20
- {:function => lambda { |year| Holidays.easter(year)-1 }, :function_id => "easter(year)-1", :name => "Easter Saturday", :regions => [:au]},
21
- {:function => lambda { |year| Holidays.easter(year)+1 }, :function_id => "easter(year)+1", :name => "Easter Monday", :regions => [:au]},
22
- {:function => lambda { |year| Holidays.easter(year)+2 }, :function_id => "easter(year)+2", :name => "Easter Monday", :regions => [:au_tas]}],
23
- 6 => [{:wday => 1, :week => 1, :name => "Foundation Day", :regions => [:au_wa]},
24
- {:wday => 1, :week => 2, :name => "Queen's Birthday", :regions => [:au_act, :au_nsw, :au_sa, :au_tas, :au_nt, :au_qld, :au_vic]},
25
- {:mday => 6, :type => :informal, :name => "Queensland Day", :regions => [:au_qld]}],
26
- 1 => [{:mday => 1, :name => "New Year's Day", :regions => [:au]},
27
- {:mday => 26, :name => "Australia Day", :regions => [:au]}],
28
- 12 => [{:mday => 25, :name => "Christmas Day", :regions => [:au]},
29
- {:mday => 26, :name => "Boxing Day", :regions => [:au]}],
30
- 3 => [{:wday => 1, :week => 1, :name => "Labour Day", :regions => [:au_wa]},
31
- {:wday => 1, :week => 2, :name => "Eight Hours Day", :regions => [:au_tas]},
32
- {:wday => 1, :week => 2, :name => "Labour Day", :regions => [:au_vic]}],
33
- 4 => [{:mday => 25, :name => "ANZAC Day", :regions => [:au]}],
34
- 10 => [{:wday => 1, :week => 1, :name => "Labour Day", :regions => [:au_act, :au_nsw, :au_sa]}]
35
- }
36
- end
37
-
38
-
39
- end
40
-
41
- Holidays.merge_defs(Holidays::AU::DEFINED_REGIONS, Holidays::AU::HOLIDAYS_BY_MONTH)
1
+ # encoding: utf-8
2
+ module Holidays
3
+ # This file is generated by the Ruby Holiday gem.
4
+ #
5
+ # Definitions loaded: data/au.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/au'
12
+ #
13
+ # More definitions are available at http://code.dunae.ca/holidays.
14
+ module AU # :nodoc:
15
+ DEFINED_REGIONS = [:au, :au_tas, :au_wa, :au_vic, :au_qld, :au_nt, :au_act, :au_nsw, :au_sa, :au_qld_brisbane]
16
+
17
+ HOLIDAYS_BY_MONTH = {
18
+ 0 => [{:function => lambda { |year| Holidays.easter(year)-2 }, :function_id => "easter(year)-2", :name => "Good Friday", :regions => [:au]},
19
+ {:function => lambda { |year| Holidays.easter(year)-1 }, :function_id => "easter(year)-1", :name => "Easter Saturday", :regions => [:au]},
20
+ {:function => lambda { |year| Holidays.easter(year)+1 }, :function_id => "easter(year)+1", :name => "Easter Monday", :regions => [:au]},
21
+ {:function => lambda { |year| Holidays.easter(year)+2 }, :function_id => "easter(year)+2", :name => "Easter Monday", :regions => [:au_tas]}],
22
+ 1 => [{:mday => 1, :name => "New Year's Day", :regions => [:au]},
23
+ {:mday => 26, :name => "Australia Day", :regions => [:au]}],
24
+ 3 => [{:wday => 1, :week => 1, :name => "Labour Day", :regions => [:au_wa]},
25
+ {:wday => 1, :week => 2, :name => "Eight Hours Day", :regions => [:au_tas]},
26
+ {:wday => 1, :week => 2, :name => "Labour Day", :regions => [:au_vic]}],
27
+ 4 => [{:mday => 25, :name => "ANZAC Day", :regions => [:au]}],
28
+ 5 => [{:wday => 1, :week => 1, :name => "Labour Day", :regions => [:au_qld]},
29
+ {:wday => 1, :week => 1, :name => "May Day", :regions => [:au_nt]}],
30
+ 6 => [{:wday => 1, :week => 1, :name => "Foundation Day", :regions => [:au_wa]},
31
+ {:wday => 1, :week => 2, :name => "Queen's Birthday", :regions => [:au_act, :au_nsw, :au_sa, :au_tas, :au_nt, :au_qld, :au_vic]},
32
+ {:mday => 6, :type => :informal, :name => "Queensland Day", :regions => [:au_qld]}],
33
+ 8 => [{:wday => 3, :week => -3, :name => "Ekka", :regions => [:au_qld_brisbane]}],
34
+ 10 => [{:wday => 1, :week => 1, :name => "Labour Day", :regions => [:au_act, :au_nsw, :au_sa]}],
35
+ 12 => [{:mday => 25, :name => "Christmas Day", :regions => [:au]},
36
+ {:mday => 26, :name => "Boxing Day", :regions => [:au]}]
37
+ }
38
+ end
39
+
40
+
41
+ end
42
+
43
+ Holidays.merge_defs(Holidays::AU::DEFINED_REGIONS, Holidays::AU::HOLIDAYS_BY_MONTH)
@@ -1,68 +1,69 @@
1
- module Holidays
2
- # This file is generated by the Ruby Holiday gem.
3
- #
4
- # Definitions loaded: data/ca.yaml, data/north_america_informal.yaml
5
- #
6
- # To use the definitions in this file, load them right after you load the
7
- # Holiday gem:
8
- #
9
- # require 'holidays'
10
- # require 'holidays/ca'
11
- #
12
- # More definitions are available at http://code.dunae.ca/holidays.
13
- module CA # :nodoc:
14
- 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, :us]
15
-
16
- HOLIDAYS_BY_MONTH = {
17
- 5 => [{:function => lambda { |year| Holidays.ca_victoria_day(year) }, :function_id => "ca_victoria_day(year)", :name => "Victoria Day", :regions => [:ca]},
18
- {:function => lambda { |year| Holidays.ca_victoria_day(year) }, :function_id => "ca_victoria_day(year)", :name => "National Patriotes Day", :regions => [:ca_qc]},
19
- {:wday => 0, :week => 3, :type => :informal, :name => "Father's Day", :regions => [:us, :ca]}],
20
- 0 => [{:function => lambda { |year| Holidays.easter(year)-2 }, :function_id => "easter(year)-2", :name => "Good Friday", :regions => [:ca]},
21
- {:function => lambda { |year| Holidays.easter(year)+1 }, :function_id => "easter(year)+1", :type => :informal, :name => "Easter Monday", :regions => [:ca]}],
22
- 11 => [{:mday => 11, :name => "Rememberance Day", :regions => [:ca]}],
23
- 6 => [{:mday => 24, :name => "Discovery Day", :regions => [:ca_nf]},
24
- {:mday => 24, :name => "Fête Nationale", :regions => [:ca_qc]},
25
- {:mday => 21, :name => "National Aboriginal Day", :regions => [:ca_nt]}],
26
- 1 => [{:mday => 1, :name => "New Year's Day", :regions => [:ca]},
27
- {:mday => 2, :name => "New Year's", :regions => [:ca_qc]}],
28
- 12 => [{:mday => 25, :name => "Christmas Day", :regions => [:ca]},
29
- {:mday => 26, :name => "Boxing Day", :regions => [:ca]}],
30
- 7 => [{:mday => 1, :observed => lambda { |date| Holidays.to_monday_if_sunday(date) }, :observed_id => "to_monday_if_sunday", :name => "Canada Day", :regions => [:ca]},
31
- {:mday => 12, :name => "Orangemen's Day", :regions => [:ca_nf]},
32
- {:mday => 9, :name => "Nunavut Day", :regions => [:ca_nu]}],
33
- 2 => [{:wday => 1, :week => 3, :name => "Family Day", :regions => [:ca_ab, :ca_on, :ca_sk]},
34
- {:wday => 1, :week => 3, :name => "Louis Riel Day", :regions => [:ca_mb]},
35
- {:mday => 2, :type => :informal, :name => "Groundhog Day", :regions => [:us, :ca]},
36
- {:mday => 14, :type => :informal, :name => "Valentine's Day", :regions => [:us, :ca]}],
37
- 8 => [{:wday => 1, :week => 1, :name => "BC Day", :regions => [:ca_bc]},
38
- {:wday => 1, :week => 1, :name => "Saskatchewan Day", :regions => [:ca_sk]},
39
- {:wday => 1, :week => 1, :name => "Heritage Day", :regions => [:ca_ab]},
40
- {:wday => 1, :week => 1, :name => "Natal Day", :regions => [:ca_ns]},
41
- {:wday => 1, :week => 1, :name => "Civic Holiday", :regions => [:ca_on]},
42
- {:wday => 1, :week => 3, :name => "Discovery Day", :regions => [:ca_yk]}],
43
- 3 => [{:mday => 23, :name => "St. George's Day", :regions => [:ca_nf]},
44
- {:mday => 17, :type => :informal, :name => "St. Patrick's Day", :regions => [:us, :ca]}],
45
- 9 => [{:wday => 1, :week => 1, :name => "Labour Day", :regions => [:ca]}],
46
- 4 => [{:mday => 1, :type => :informal, :name => "April Fool's Day", :regions => [:us, :ca]},
47
- {:mday => 22, :type => :informal, :name => "Earth Day", :regions => [:us, :ca]}],
48
- 10 => [{:wday => 1, :week => 2, :name => "Thanksgiving", :regions => [:ca]},
49
- {:mday => 31, :type => :informal, :name => "Halloween", :regions => [:us, :ca]}]
50
- }
51
- end
52
-
53
- # Monday on or before May 24
54
- def self.ca_victoria_day(year)
55
- date = Date.civil(year,5,24)
56
- if date.wday > 1
57
- date -= (date.wday - 1)
58
- elsif date.wday == 0
59
- date -= 6
60
- end
61
- date
62
- end
63
-
64
-
65
-
66
- end
67
-
68
- Holidays.merge_defs(Holidays::CA::DEFINED_REGIONS, Holidays::CA::HOLIDAYS_BY_MONTH)
1
+ # encoding: utf-8
2
+ module Holidays
3
+ # This file is generated by the Ruby Holiday gem.
4
+ #
5
+ # Definitions loaded: data/ca.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/ca'
12
+ #
13
+ # More definitions are available at http://code.dunae.ca/holidays.
14
+ module CA # :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, :us]
16
+
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
+ 1 => [{:mday => 1, :name => "New Year's Day", :regions => [:ca]},
21
+ {:mday => 2, :name => "New Year's", :regions => [:ca_qc]}],
22
+ 2 => [{:wday => 1, :week => 3, :name => "Family Day", :regions => [:ca_ab, :ca_on, :ca_sk]},
23
+ {:wday => 1, :week => 3, :name => "Louis Riel Day", :regions => [:ca_mb]},
24
+ {:mday => 2, :type => :informal, :name => "Groundhog Day", :regions => [:us, :ca]},
25
+ {:mday => 14, :type => :informal, :name => "Valentine's Day", :regions => [:us, :ca]}],
26
+ 3 => [{:mday => 23, :name => "St. George's Day", :regions => [:ca_nf]},
27
+ {:mday => 17, :type => :informal, :name => "St. Patrick's Day", :regions => [:us, :ca]}],
28
+ 5 => [{:function => lambda { |year| Holidays.ca_victoria_day(year) }, :function_id => "ca_victoria_day(year)", :name => "Victoria Day", :regions => [:ca]},
29
+ {:function => lambda { |year| Holidays.ca_victoria_day(year) }, :function_id => "ca_victoria_day(year)", :name => "National Patriotes Day", :regions => [:ca_qc]},
30
+ {:wday => 0, :week => 3, :type => :informal, :name => "Father's Day", :regions => [:us, :ca]}],
31
+ 6 => [{:mday => 24, :name => "Discovery Day", :regions => [:ca_nf]},
32
+ {:mday => 24, :name => "Fête Nationale", :regions => [:ca_qc]},
33
+ {:mday => 21, :name => "National Aboriginal Day", :regions => [:ca_nt]}],
34
+ 7 => [{:mday => 1, :observed => lambda { |date| Holidays.to_monday_if_sunday(date) }, :observed_id => "to_monday_if_sunday", :name => "Canada Day", :regions => [:ca]},
35
+ {:mday => 12, :name => "Orangemen's Day", :regions => [:ca_nf]},
36
+ {:mday => 9, :name => "Nunavut Day", :regions => [:ca_nu]}],
37
+ 8 => [{:wday => 1, :week => 1, :name => "BC Day", :regions => [:ca_bc]},
38
+ {:wday => 1, :week => 1, :name => "Saskatchewan Day", :regions => [:ca_sk]},
39
+ {:wday => 1, :week => 1, :name => "Heritage Day", :regions => [:ca_ab]},
40
+ {:wday => 1, :week => 1, :name => "Natal Day", :regions => [:ca_ns]},
41
+ {:wday => 1, :week => 1, :name => "Civic Holiday", :regions => [:ca_on]},
42
+ {:wday => 1, :week => 3, :name => "Discovery Day", :regions => [:ca_yk]}],
43
+ 9 => [{:wday => 1, :week => 1, :name => "Labour Day", :regions => [:ca]}],
44
+ 10 => [{:wday => 1, :week => 2, :name => "Thanksgiving", :regions => [:ca]},
45
+ {:mday => 31, :type => :informal, :name => "Halloween", :regions => [:us, :ca]}],
46
+ 11 => [{:mday => 11, :name => "Rememberance Day", :regions => [:ca]}],
47
+ 12 => [{:mday => 25, :name => "Christmas Day", :regions => [:ca]},
48
+ {:mday => 26, :name => "Boxing Day", :regions => [:ca]}],
49
+ 4 => [{:mday => 1, :type => :informal, :name => "April Fool's Day", :regions => [:us, :ca]},
50
+ {:mday => 22, :type => :informal, :name => "Earth Day", :regions => [:us, :ca]}]
51
+ }
52
+ end
53
+
54
+ # Monday on or before May 24
55
+ def self.ca_victoria_day(year)
56
+ date = Date.civil(year,5,24)
57
+ if date.wday > 1
58
+ date -= (date.wday - 1)
59
+ elsif date.wday == 0
60
+ date -= 6
61
+ end
62
+ date
63
+ end
64
+
65
+
66
+
67
+ end
68
+
69
+ Holidays.merge_defs(Holidays::CA::DEFINED_REGIONS, Holidays::CA::HOLIDAYS_BY_MONTH)
@@ -0,0 +1,36 @@
1
+ # encoding: utf-8
2
+ module Holidays
3
+ # This file is generated by the Ruby Holiday gem.
4
+ #
5
+ # Definitions loaded: data/cz.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/cz'
12
+ #
13
+ # More definitions are available at http://code.dunae.ca/holidays.
14
+ module CZ # :nodoc:
15
+ DEFINED_REGIONS = [:cz]
16
+
17
+ HOLIDAYS_BY_MONTH = {
18
+ 0 => [{:function => lambda { |year| Holidays.easter(year)+1 }, :function_id => "easter(year)+1", :name => "Velikonoční pondělí", :regions => [:cz]}],
19
+ 1 => [{:mday => 1, :name => "Den obnovy samostatného českého státu", :regions => [:cz]}],
20
+ 5 => [{:mday => 1, :name => "Svátek práce", :regions => [:cz]},
21
+ {:mday => 8, :name => "Den vítězství", :regions => [:cz]}],
22
+ 7 => [{:mday => 5, :name => "Den slovanských věrozvěstů Cyrila a Metoděje", :regions => [:cz]},
23
+ {:mday => 6, :name => "Den upálení mistra Jana Husa", :regions => [:cz]}],
24
+ 9 => [{:mday => 28, :name => "Den české státnosti", :regions => [:cz]}],
25
+ 10 => [{:mday => 28, :name => "Den vzniku samostatného československého státu", :regions => [:cz]}],
26
+ 11 => [{:mday => 17, :name => "Den boje za svobodu a demokracii", :regions => [:cz]}],
27
+ 12 => [{:mday => 24, :name => "Štědrý den", :regions => [:cz]},
28
+ {:mday => 25, :name => "1. svátek vánoční", :regions => [:cz]},
29
+ {:mday => 26, :name => "2. svátek vánoční", :regions => [:cz]}]
30
+ }
31
+ end
32
+
33
+
34
+ end
35
+
36
+ Holidays.merge_defs(Holidays::CZ::DEFINED_REGIONS, Holidays::CZ::HOLIDAYS_BY_MONTH)
@@ -1,52 +1,51 @@
1
- module Holidays
2
- # This file is generated by the Ruby Holiday gem.
3
- #
4
- # Definitions loaded: data/de.yaml
5
- #
6
- # To use the definitions in this file, load them right after you load the
7
- # Holiday gem:
8
- #
9
- # require 'holidays'
10
- # require 'holidays/de'
11
- #
12
- # More definitions are available at http://code.dunae.ca/holidays.
13
- module DE # :nodoc:
14
- DEFINED_REGIONS = [:de, :de_bw, :de_by, :de_nw, :de_rp, :de_sl, :de_sn, :de_he, :de_th, :de_bb, :de_mv, :de_st]
15
-
16
- HOLIDAYS_BY_MONTH = {
17
- 5 => [{:mday => 1, :name => "Tag der Arbeit", :regions => [:de]},
18
- {:mday => 8, :name => "Victoire 1945", :regions => [:de]}],
19
- 0 => [{:function => lambda { |year| Holidays.easter(year)-2 }, :function_id => "easter(year)-2", :name => "Karfreitag", :regions => [:de]},
20
- {:function => lambda { |year| Holidays.easter(year) }, :function_id => "easter(year)", :type => :informal, :name => "Ostern", :regions => [:de]},
21
- {:function => lambda { |year| Holidays.easter(year)+1 }, :function_id => "easter(year)+1", :name => "Ostermontag", :regions => [:de]},
22
- {:function => lambda { |year| Holidays.easter(year)+39 }, :function_id => "easter(year)+39", :name => "Christi Himmelfahrt", :regions => [:de]},
23
- {:function => lambda { |year| Holidays.easter(year)+50 }, :function_id => "easter(year)+50", :name => "Pfingstmontag", :regions => [:de]},
24
- {:function => lambda { |year| Holidays.easter(year)+60 }, :function_id => "easter(year)+60", :name => "Fronleichnam", :regions => [:de_bw, :de_by, :de_he, :de_nw, :de_rp, :de_sl, :de_sn, :de_th]}],
25
- 11 => [{:mday => 1, :name => "Allerheiligen", :regions => [:de_bw, :de_by, :de_nw, :de_rp, :de_sl]},
26
- {:function => lambda { |year| Holidays.de_buss_und_bettag(year) }, :function_id => "de_buss_und_bettag(year)", :name => "Buß- und Bettag", :regions => [:de_by, :de_sn]}],
27
- 1 => [{:mday => 1, :name => "Neujahrstag", :regions => [:de]},
28
- {:mday => 6, :name => "Heilige Drei Könige", :regions => [:de_bw, :de_by]}],
29
- 12 => [{:mday => 25, :name => "1. Weihnachtstag", :regions => [:de]},
30
- {:mday => 26, :name => "2. Weihnachtstag", :regions => [:de]}],
31
- 8 => [{:mday => 15, :name => "Mariä Himmelfahrt", :regions => [:de_by, :de_sl]}],
32
- 10 => [{:mday => 3, :name => "Tag der Deutschen Einheit", :regions => [:de]},
33
- {:mday => 31, :name => "Reformationstag", :regions => [:de_bb, :de_mv, :de_sn, :de_st, :de_th]}]
34
- }
35
- end
36
-
37
- # Germany: Wednesday before November 23
38
- def self.de_buss_und_bettag(year)
39
- date = Date.civil(year,11,23)
40
- if date.wday > 3
41
- date -= (date.wday - 3)
42
- else
43
- date -= (date.wday + 4)
44
- end
45
- date
46
- end
47
-
48
-
49
-
50
- end
51
-
52
- Holidays.merge_defs(Holidays::DE::DEFINED_REGIONS, Holidays::DE::HOLIDAYS_BY_MONTH)
1
+ # encoding: utf-8
2
+ module Holidays
3
+ # This file is generated by the Ruby Holiday gem.
4
+ #
5
+ # Definitions loaded: data/de.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/de'
12
+ #
13
+ # More definitions are available at http://code.dunae.ca/holidays.
14
+ module DE # :nodoc:
15
+ DEFINED_REGIONS = [:de, :de_bw, :de_by, :de_he, :de_nw, :de_rp, :de_sl, :de_st, :de_bb, :de_mv, :de_sn, :de_th]
16
+
17
+ HOLIDAYS_BY_MONTH = {
18
+ 0 => [{:function => lambda { |year| Holidays.easter(year)-2 }, :function_id => "easter(year)-2", :name => "Karfreitag", :regions => [:de]},
19
+ {:function => lambda { |year| Holidays.easter(year)+1 }, :function_id => "easter(year)+1", :name => "Ostermontag", :regions => [:de]},
20
+ {:function => lambda { |year| Holidays.easter(year)+39 }, :function_id => "easter(year)+39", :name => "Christi Himmelfahrt", :regions => [:de]},
21
+ {:function => lambda { |year| Holidays.easter(year)+50 }, :function_id => "easter(year)+50", :name => "Pfingstmontag", :regions => [:de]},
22
+ {:function => lambda { |year| Holidays.easter(year)+60 }, :function_id => "easter(year)+60", :name => "Fronleichnam", :regions => [:de_bw, :de_by, :de_he, :de_nw, :de_rp, :de_sl]}],
23
+ 1 => [{:mday => 1, :name => "Neujahrstag", :regions => [:de]},
24
+ {:mday => 6, :name => "Heilige Drei Könige", :regions => [:de_bw, :de_by, :de_st]}],
25
+ 5 => [{:mday => 1, :name => "Tag der Arbeit", :regions => [:de]}],
26
+ 8 => [{:mday => 15, :name => "Mariä Himmelfahrt", :regions => [:de_by, :de_sl]}],
27
+ 10 => [{:mday => 3, :name => "Tag der Deutschen Einheit", :regions => [:de]},
28
+ {:mday => 31, :name => "Reformationstag", :regions => [:de_bb, :de_mv, :de_sn, :de_st, :de_th]}],
29
+ 11 => [{:mday => 1, :name => "Allerheiligen", :regions => [:de_bw, :de_by, :de_nw, :de_rp, :de_sl]},
30
+ {:function => lambda { |year| Holidays.de_buss_und_bettag(year) }, :function_id => "de_buss_und_bettag(year)", :name => "Buß- und Bettag", :regions => [:de_sn]}],
31
+ 12 => [{:mday => 25, :name => "1. Weihnachtstag", :regions => [:de]},
32
+ {:mday => 26, :name => "2. Weihnachtstag", :regions => [:de]}]
33
+ }
34
+ end
35
+
36
+ # Germany: Wednesday before November 23
37
+ def self.de_buss_und_bettag(year)
38
+ date = Date.civil(year,11,23)
39
+ if date.wday > 3
40
+ date -= (date.wday - 3)
41
+ else
42
+ date -= (date.wday + 4)
43
+ end
44
+ date
45
+ end
46
+
47
+
48
+
49
+ end
50
+
51
+ Holidays.merge_defs(Holidays::DE::DEFINED_REGIONS, Holidays::DE::HOLIDAYS_BY_MONTH)
@@ -1,47 +1,48 @@
1
- module Holidays
2
- # This file is generated by the Ruby Holiday gem.
3
- #
4
- # Definitions loaded: data/dk.yaml
5
- #
6
- # To use the definitions in this file, load them right after you load the
7
- # Holiday gem:
8
- #
9
- # require 'holidays'
10
- # require 'holidays/dk'
11
- #
12
- # More definitions are available at http://code.dunae.ca/holidays.
13
- module DK # :nodoc:
14
- DEFINED_REGIONS = [:dk]
15
-
16
- HOLIDAYS_BY_MONTH = {
17
- 5 => [{:mday => 1, :name => "Arbejdernes kampdag", :regions => [:dk]},
18
- {:mday => 5, :type => :informal, :name => "Danmarks befrielse", :regions => [:dk]}],
19
- 0 => [{:function => lambda { |year| Holidays.easter(year)-49 }, :function_id => "easter(year)-49", :type => :informal, :name => "Fastelavn", :regions => [:dk]},
20
- {:function => lambda { |year| Holidays.easter(year)-7 }, :function_id => "easter(year)-7", :name => "Palmesøndag", :regions => [:dk]},
21
- {:function => lambda { |year| Holidays.easter(year)-3 }, :function_id => "easter(year)-3", :name => "Skærtorsdag", :regions => [:dk]},
22
- {:function => lambda { |year| Holidays.easter(year)-2 }, :function_id => "easter(year)-2", :name => "Langfredag", :regions => [:dk]},
23
- {:function => lambda { |year| Holidays.easter(year) }, :function_id => "easter(year)", :name => "Påskedag", :regions => [:dk]},
24
- {:function => lambda { |year| Holidays.easter(year)+1 }, :function_id => "easter(year)+1", :name => "2. påskedag", :regions => [:dk]},
25
- {:function => lambda { |year| Holidays.easter(year)+26 }, :function_id => "easter(year)+26", :name => "Store Bededag", :regions => [:dk]},
26
- {:function => lambda { |year| Holidays.easter(year)+39 }, :function_id => "easter(year)+39", :name => "Kristi Himmelfartsdag", :regions => [:dk]},
27
- {:function => lambda { |year| Holidays.easter(year)+49 }, :function_id => "easter(year)+49", :name => "Pinsedag", :regions => [:dk]},
28
- {:function => lambda { |year| Holidays.easter(year)+50 }, :function_id => "easter(year)+50", :name => "2. Pinsedag", :regions => [:dk]}],
29
- 11 => [{:mday => 10, :type => :informal, :name => "Mortensaften", :regions => [:dk]}],
30
- 6 => [{:mday => 5, :name => "Grundlovsdag", :regions => [:dk]},
31
- {:mday => 15, :type => :informal, :name => "Valdemarsdag og Genforeningsdag", :regions => [:dk]},
32
- {:mday => 23, :type => :informal, :name => "Sankt Hans aften", :regions => [:dk]}],
33
- 1 => [{:mday => 1, :name => "Nytårsdag", :regions => [:dk]}],
34
- 12 => [{:mday => 13, :type => :informal, :name => "Sankt Lucia", :regions => [:dk]},
35
- {:mday => 24, :name => "Juleaftensdag", :regions => [:dk]},
36
- {:mday => 25, :name => "1. juledag", :regions => [:dk]},
37
- {:mday => 26, :name => "2. juledag", :regions => [:dk]}],
38
- 4 => [{:mday => 1, :type => :informal, :name => "1. april", :regions => [:dk]},
39
- {:mday => 9, :type => :informal, :name => "Danmarks besættelse", :regions => [:dk]},
40
- {:mday => 16, :type => :informal, :name => "Dronningens fødselsdag", :regions => [:dk]}]
41
- }
42
- end
43
-
44
-
45
- end
46
-
47
- Holidays.merge_defs(Holidays::DK::DEFINED_REGIONS, Holidays::DK::HOLIDAYS_BY_MONTH)
1
+ # encoding: utf-8
2
+ module Holidays
3
+ # This file is generated by the Ruby Holiday gem.
4
+ #
5
+ # Definitions loaded: data/dk.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/dk'
12
+ #
13
+ # More definitions are available at http://code.dunae.ca/holidays.
14
+ module DK # :nodoc:
15
+ DEFINED_REGIONS = [:dk]
16
+
17
+ HOLIDAYS_BY_MONTH = {
18
+ 0 => [{:function => lambda { |year| Holidays.easter(year)-49 }, :function_id => "easter(year)-49", :type => :informal, :name => "Fastelavn", :regions => [:dk]},
19
+ {:function => lambda { |year| Holidays.easter(year)-7 }, :function_id => "easter(year)-7", :name => "Palmesøndag", :regions => [:dk]},
20
+ {:function => lambda { |year| Holidays.easter(year)-3 }, :function_id => "easter(year)-3", :name => "Skærtorsdag", :regions => [:dk]},
21
+ {:function => lambda { |year| Holidays.easter(year)-2 }, :function_id => "easter(year)-2", :name => "Langfredag", :regions => [:dk]},
22
+ {:function => lambda { |year| Holidays.easter(year) }, :function_id => "easter(year)", :name => "Påskedag", :regions => [:dk]},
23
+ {:function => lambda { |year| Holidays.easter(year)+1 }, :function_id => "easter(year)+1", :name => "2. påskedag", :regions => [:dk]},
24
+ {:function => lambda { |year| Holidays.easter(year)+26 }, :function_id => "easter(year)+26", :name => "Store Bededag", :regions => [:dk]},
25
+ {:function => lambda { |year| Holidays.easter(year)+39 }, :function_id => "easter(year)+39", :name => "Kristi Himmelfartsdag", :regions => [:dk]},
26
+ {:function => lambda { |year| Holidays.easter(year)+49 }, :function_id => "easter(year)+49", :name => "Pinsedag", :regions => [:dk]},
27
+ {:function => lambda { |year| Holidays.easter(year)+50 }, :function_id => "easter(year)+50", :name => "2. Pinsedag", :regions => [:dk]}],
28
+ 1 => [{:mday => 1, :name => "Nytårsdag", :regions => [:dk]}],
29
+ 4 => [{:mday => 1, :type => :informal, :name => "1. april", :regions => [:dk]},
30
+ {:mday => 9, :type => :informal, :name => "Danmarks besættelse", :regions => [:dk]},
31
+ {:mday => 16, :type => :informal, :name => "Dronningens fødselsdag", :regions => [:dk]}],
32
+ 5 => [{:mday => 1, :name => "Arbejdernes kampdag", :regions => [:dk]},
33
+ {:mday => 5, :type => :informal, :name => "Danmarks befrielse", :regions => [:dk]}],
34
+ 6 => [{:mday => 5, :name => "Grundlovsdag", :regions => [:dk]},
35
+ {:mday => 15, :type => :informal, :name => "Valdemarsdag og Genforeningsdag", :regions => [:dk]},
36
+ {:mday => 23, :type => :informal, :name => "Sankt Hans aften", :regions => [:dk]}],
37
+ 11 => [{:mday => 10, :type => :informal, :name => "Mortensaften", :regions => [:dk]}],
38
+ 12 => [{:mday => 13, :type => :informal, :name => "Sankt Lucia", :regions => [:dk]},
39
+ {:mday => 24, :name => "Juleaftensdag", :regions => [:dk]},
40
+ {:mday => 25, :name => "1. juledag", :regions => [:dk]},
41
+ {:mday => 26, :name => "2. juledag", :regions => [:dk]}]
42
+ }
43
+ end
44
+
45
+
46
+ end
47
+
48
+ Holidays.merge_defs(Holidays::DK::DEFINED_REGIONS, Holidays::DK::HOLIDAYS_BY_MONTH)