2008-12-30 20:43:29 +01:00
|
|
|
module Holidays
|
|
|
|
# This file is generated by the Ruby Holiday gem.
|
|
|
|
#
|
|
|
|
# Definitions loaded: data/gb.yaml
|
|
|
|
#
|
|
|
|
# To use the definitions in this file, load them right after you load the
|
|
|
|
# Holiday gem:
|
|
|
|
#
|
|
|
|
# require 'holidays'
|
|
|
|
# require 'holidays/gb'
|
|
|
|
#
|
|
|
|
# More definitions are available at http://code.dunae.ca/holidays.
|
|
|
|
module GB # :nodoc:
|
|
|
|
DEFINED_REGIONS = [:gb, :je, :gb_jsy, :gg, :gb_gsy, :gb_eng, :gb_wls, :gb_eaw, :gb_nir, :gb_sct, :im, :gb_iom, :gb_con]
|
|
|
|
|
|
|
|
HOLIDAYS_BY_MONTH = {
|
|
|
|
5 => [{:wday => 1, :week => 1, :name => "May Day", :regions => [:gb]},
|
|
|
|
{:mday => 9, :name => "Liberation Day", :regions => [:je, :gb_jsy, :gg, :gb_gsy]},
|
|
|
|
{:wday => 1, :week => -1, :name => "Bank Holiday", :regions => [:gb]}],
|
|
|
|
0 => [{:function => lambda { |year| Holidays.easter(year)-2 }, :function_id => "easter(year)-2", :name => "Good Friday", :regions => [:gb]},
|
|
|
|
{:function => lambda { |year| Holidays.easter(year) }, :function_id => "easter(year)", :name => "Easter Sunday", :regions => [:gb]},
|
|
|
|
{:function => lambda { |year| Holidays.easter(year)+1 }, :function_id => "easter(year)+1", :name => "Easter Monday", :regions => [:gb_eng, :gb_wls, :gb_eaw, :gb_nir]}],
|
|
|
|
11 => [{:mday => 5, :type => :informal, :name => "Guy Fawkes Day", :regions => [:gb]}],
|
|
|
|
1 => [{:mday => 1, :name => "New Year's Day", :regions => [:gb]},
|
|
|
|
{:mday => 2, :name => "New Year's", :regions => [:gb_sct]}],
|
|
|
|
12 => [{:mday => 25, :observed => lambda { |date| Holidays.to_monday_if_weekend(date) }, :observed_id => "to_monday_if_weekend", :name => "Christmas Day", :regions => [:gb]},
|
|
|
|
{:mday => 26, :observed => lambda { |date| Holidays.to_weekday_if_boxing_weekend(date) }, :observed_id => "to_weekday_if_boxing_weekend", :name => "Boxing Day", :regions => [:gb]}],
|
|
|
|
7 => [{:mday => 5, :name => "Tynwald Day", :regions => [:im, :gb_iom]},
|
|
|
|
{:mday => 12, :name => "Battle of the Boyne", :regions => [:gb_nir]}],
|
|
|
|
8 => [{:wday => 1, :week => 1, :name => "Bank Holiday", :regions => [:gb_sct]},
|
|
|
|
{:wday => 1, :week => -1, :name => "Bank Holiday", :regions => [:gb_eng, :gb_wls, :gb_eaw, :gb_nir]}],
|
|
|
|
3 => [{:mday => 5, :name => "St. Piran's Day", :regions => [:gb_con]},
|
|
|
|
{:mday => 17, :name => "St. Patrick's Day", :regions => [:gb_nir]}]
|
|
|
|
}
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
Holidays.merge_defs(Holidays::GB::DEFINED_REGIONS, Holidays::GB::HOLIDAYS_BY_MONTH)
|