lib/vscal/special_dates.rb
# initialize the holiday data based on both the fixed configuration (for dates
# that are always the same every year, like Christmas) and the data that needs to
# be calculated separately for each year based on some rules, such as Easter
initialize the holiday data based on both the fixed configuration (for dates
that are always the same every year, like Christmas) and the data that needs to
be calculated separately for each year based on some rules, such as Easter
initialize the holiday data based on both the fixed configuration ( for dates that are always the same every year like Christmas ) and the data that needs to be calculated separately for each year based on some rules such as Easter
def holidays
      holidays = FIXED_HOLIDAYS.map { |day| Date.new(@year, day[1], day[0]) }
      easter_date = easter  
      holidays + [
        easter_date,
        easter_date - 2,      
        easter_date - 1,      
        easter_date + 1,      
        easter_date + 39,     
        midsummer_eve,
        midsummer_eve + 1,
        all_hallows_day
      ]
    end
def holidays holidays = FIXED_HOLIDAYS . map { | day | Date . new ( @year , day [ 1 ] , day [ 0 ] ) } easter_date = easter holidays + [ easter_date , easter_date - 2 , easter_date - 1 , easter_date + 1 , easter_date + 39 , midsummer_eve , midsummer_eve + 1 , all_hallows_day ] end
initialize the holiday data based on both the fixed configuration (for dates
that are always the same every year, like Christmas) and the data that needs to
be calculated separately for each year based on some rules, such as Easter
initialize the holiday data based on both the fixed configuration ( for dates that are always the same every year like Christmas ) and the data that needs to be calculated separately for each year based on some rules such as Easter
# calculate easter location only once, use many times below # Good Friday # Easter Saturday # Monday after Easter # Ascension Day, Finnish "Helatorstai"