Method: Holidays::CH.custom_methods

Defined in:
lib/generated_definitions/ch.rb

.custom_methodsObject



49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# File 'lib/generated_definitions/ch.rb', line 49

def self.custom_methods
  {
    "ch_vd_lundi_du_jeune_federal(year)" => Proc.new { |year|
date = Date.civil(year,9,1)
# Find the first Sunday of September
until date.wday.eql? 0 do
  date += 1
end
# There are 15 days between the first Sunday
# and the Monday after the third Sunday
date + 15
},

"ch_ge_jeune_genevois(year)" => Proc.new { |year|
date = Date.civil(year,9,1)
# Find the first Sunday of September
until date.wday.eql? 0 do
  date += 1
end
# Thursday is four days after Sunday
date + 4
},

"ch_gl_naefelser_fahrt(year)" => Proc.new { |year|
date = Date.civil(year,4,1)
# Find the first Thursday of April
until date.wday.eql? 4 do
  date += 1
end

if date.eql?(Holidays::Factory::DateCalculator::Easter::Gregorian.easter_calculator.calculate_easter_for(year)-3)
  date += 7
end
date
},


  }
end