module Holidays::AU
def self.custom_methods
def self.custom_methods { "afl_grand_final(year)" => Proc.new { |year| year 2015 te.civil(2015, 10, 2) 2016 te.civil(2016, 9, 30) 2017 te.civil(2017, 9, 29) 2020 te.civil(2020, 10, 23) 2022 te.civil(2022, 9, 23) Friday before AFL Grand Final typically falls on the last Friday in September Override when falls on a different date st_day = Date.civil(year, 9, -1) st_friday = last_day - ((last_day.wday - 5) % 7) st_friday _queens_bday_october(year)" => Proc.new { |year| ear >= 2016 lidays::Factory::DateCalculator.day_of_month_calculator.call(year, 10, 1, 1) f year == 2012 l _kings_bday_october(year)" => Proc.new { |year| ear >= 2023 lidays::Factory::DateCalculator.day_of_month_calculator.call(year, 10, 1, 1) l _queens_birthday_june(year)" => Proc.new { |year| ear <= 2015 lidays::Factory::DateCalculator.day_of_month_calculator.call(year, 6, 2, 1) _labour_day_may(year)" => Proc.new { |year| ear < 2013 || year >= 2016 lidays::Factory::DateCalculator.day_of_month_calculator.call(year, 5, 1, 1) _labour_day_october(year)" => Proc.new { |year| ear >= 2013 && year < 2016 lidays::Factory::DateCalculator.day_of_month_calculator.call(year, 10, 1, 1) _day_2014_only(year)" => Proc.new { |year| == 2014 ? 14 : nil art_show_day(year)" => Proc.new { |year| th_sat_in_oct = Date.civil(year, 10, Holidays::Factory::DateCalculator.day_of_month_calculator.call(year, 10, 4, :saturday)) th_sat_in_oct - 2 # the thursday before ch_pub_hol_sa(year)" => Proc.new { |year| ear < 2006 l te.civil(year, 3, Holidays::Factory::DateCalculator.day_of_month_calculator.call(year, 3, :second, :monday)) _pub_hol_sa(year)" => Proc.new { |year| ear >= 2006 l te.civil(year, 5, Holidays::Factory::DateCalculator.day_of_month_calculator.call(year, 5, :third, :monday)) _brisbane_ekka_holiday(year)" => Proc.new { |year| t_friday = Holidays::Factory::DateCalculator.day_of_month_calculator.call(year, 8, :first, :friday) irst_friday < 5 cond_friday = Date.civil(year, 8, Holidays::Factory::DateCalculator.day_of_month_calculator.call(year, 8, :second, :friday)) cond_friday + 5 # The next Wednesday te.civil(year, 8, first_friday) + 5 nearest_monday_after(date)" => Proc.new { |date| date.wday 6 te += 2 5 te += 3 4 te += 4 3 te += 5 2 te += 6 0 te += 1 } end
def self.defined_regions
All the definitions are available at https://github.com/holidays/holidays
Definitions loaded: definitions/au.yaml
This file is generated by the Ruby Holidays gem.
def self.defined_regions [:au, :au_nsw, :au_vic, :au_qld, :au_nt, :au_act, :au_sa, :au_wa, :au_tas, :au_tas_south, :au_qld_cairns, :au_qld_brisbane, :au_tas_north, :au_vic_melbourne] end
def self.holidays_by_month
def self.holidays_by_month { 0 => [{:function => "easter(year)", :function_arguments => [:year], :function_modifier => -2, :name => "Good Friday", :regions => [:au]}, {:function => "easter(year)", :function_arguments => [:year], :function_modifier => -1, :name => "Easter Saturday", :regions => [:au_nsw, :au_vic, :au_qld, :au_nt, :au_act, :au_sa]}, {:function => "easter(year)", :function_arguments => [:year], :name => "Easter Sunday", :regions => [:au_nsw, :au_vic]}, {:function => "easter(year)", :function_arguments => [:year], :year_ranges => { :from => 2017 },:name => "Easter Sunday", :regions => [:au_qld, :au_act]}, {:function => "easter(year)", :function_arguments => [:year], :function_modifier => 1, :name => "Easter Monday", :regions => [:au]}], 1 => [{:mday => 1, :observed => "to_monday_if_weekend(date)", :observed_arguments => [:date], :name => "New Year's Day", :regions => [:au, :au_nsw, :au_vic, :au_act, :au_sa, :au_wa, :au_nt, :au_qld]}, {:mday => 1, :function => "to_monday_if_weekend(date)", :function_arguments => [:date], :name => "New Year's Day", :regions => [:au_tas]}, {:mday => 26, :observed => "to_monday_if_weekend(date)", :observed_arguments => [:date], :name => "Australia Day", :regions => [:au]}], 2 => [{:wday => 1, :week => 2, :name => "Royal Hobart Regatta", :regions => [:au_tas_south]}], 3 => [{:wday => 1, :week => 1, :name => "Labour Day", :regions => [:au_wa]}, {:wday => 1, :week => 2, :name => "Eight Hours Day", :regions => [:au_tas]}, {:wday => 1, :week => 2, :name => "Labour Day", :regions => [:au_vic]}, {:function => "march_pub_hol_sa(year)", :function_arguments => [:year], :name => "March Public Holiday", :regions => [:au_sa]}, {:wday => 1, :week => 2, :name => "Canberra Day", :regions => [:au_act]}], 4 => [{:mday => 25, :name => "ANZAC Day", :regions => [:au, :au_vic]}, {:mday => 25, :observed => "to_monday_if_sunday(date)", :observed_arguments => [:date], :name => "ANZAC Day", :regions => [:au_qld, :au_nt, :au_act, :au_sa]}, {:mday => 25, :observed => "to_monday_if_weekend(date)", :observed_arguments => [:date], :name => "ANZAC Day", :regions => [:au_wa]}], 5 => [{:function => "qld_labour_day_may(year)", :function_arguments => [:year], :name => "Labour Day", :regions => [:au_qld]}, {:wday => 1, :week => 1, :name => "May Day", :regions => [:au_nt]}, {:function => "may_pub_hol_sa(year)", :function_arguments => [:year], :name => "May Public Holiday", :regions => [:au_sa]}, {:mday => 27, :function => "to_nearest_monday_after(date)", :function_arguments => [:date], :year_ranges => { :from => 2018 },:name => "Reconciliation Day", :regions => [:au_act]}], 6 => [{:wday => 1, :week => 1, :name => "Western Australia Day", :regions => [:au_wa]}, {:wday => 1, :week => 2, :year_ranges => { :until => 2022 },:name => "Queen's Birthday", :regions => [:au_act, :au_nsw, :au_sa, :au_tas, :au_nt, :au_vic]}, {:wday => 1, :week => 2, :year_ranges => { :from => 2023 },:name => "King's Birthday", :regions => [:au_act, :au_nsw, :au_sa, :au_tas, :au_nt, :au_vic]}, {:function => "qld_queens_birthday_june(year)", :function_arguments => [:year], :name => "Queen's Birthday", :regions => [:au_qld]}, {:mday => 6, :type => :informal, :name => "Queensland Day", :regions => [:au_qld]}], 7 => [{:wday => 5, :week => 3, :name => "Cairns Show", :regions => [:au_qld_cairns]}], 8 => [{:function => "qld_brisbane_ekka_holiday(year)", :function_arguments => [:year], :name => "Ekka", :regions => [:au_qld_brisbane]}], 9 => [{:mday => 22, :year_ranges => { :limited => [2022] },:name => "National Day of Mourning for Her Majesty Queen Elizabeth II", :regions => [:au]}, {:wday => 1, :week => -1, :year_ranges => { :until => 2021 },:name => "Queen's Birthday", :regions => [:au_wa]}, {:wday => 1, :week => -1, :year_ranges => { :from => 2022 },:name => "King's Birthday", :regions => [:au_wa]}, {:wday => 1, :week => -1, :year_ranges => { :until => 2017 },:name => "Family & Community Day", :regions => [:au_act]}], 10 => [{:function => "afl_grand_final(year)", :function_arguments => [:year], :name => "Friday before the AFL Grand Final", :regions => [:au_vic]}, {:wday => 1, :week => 1, :name => "Labour Day", :regions => [:au_act, :au_nsw, :au_sa]}, {:function => "qld_labour_day_october(year)", :function_arguments => [:year], :observed => "to_monday_if_weekend(date)", :observed_arguments => [:date], :name => "Labour Day", :regions => [:au_qld]}, {:function => "qld_queens_bday_october(year)", :function_arguments => [:year], :year_ranges => { :until => 2022 },:observed => "to_monday_if_weekend(date)", :observed_arguments => [:date], :name => "Queen's Birthday", :regions => [:au_qld]}, {:function => "qld_kings_bday_october(year)", :function_arguments => [:year], :year_ranges => { :from => 2023 },:observed => "to_monday_if_weekend(date)", :observed_arguments => [:date], :name => "King's Birthday", :regions => [:au_qld]}, {:function => "hobart_show_day(year)", :function_arguments => [:year], :name => "Royal Hobart Show", :regions => [:au_tas_south]}], 11 => [{:function => "g20_day_2014_only(year)", :function_arguments => [:year], :name => "G20 Day", :regions => [:au_qld_brisbane]}, {:wday => 1, :week => 1, :name => "Recreation Day", :regions => [:au_tas_north]}, {:wday => 2, :week => 1, :name => "Melbourne Cup Day", :regions => [:au_vic_melbourne]}], 12 => [{:mday => 25, :observed => "to_tuesday_if_sunday_or_monday_if_saturday(date)", :observed_arguments => [:date], :name => "Christmas Day", :regions => [:au_qld, :au_nsw, :au_act, :au_tas, :au_wa, :au_vic, :au_nt]}, {:mday => 26, :observed => "to_tuesday_if_sunday_or_monday_if_saturday(date)", :observed_arguments => [:date], :name => "Boxing Day", :regions => [:au_nsw, :au_vic, :au_qld, :au_act, :au_wa]}, {:function => "to_weekday_if_boxing_weekend_from_year(year)", :function_arguments => [:year], :name => "Boxing Day", :regions => [:au_tas, :au_nt]}, {:function => "to_weekday_if_boxing_weekend_from_year_or_to_tuesday_if_monday(year)", :function_arguments => [:year], :name => "Proclamation Day", :regions => [:au_sa]}, {:mday => 25, :observed => "to_monday_if_weekend(date)", :observed_arguments => [:date], :name => "Christmas Day", :regions => [:au_sa]}] } end