Date-Calc
view release on metacpan or search on metacpan
lib/Date/Calendar/Profiles.pm view on Meta::CPAN
"2. Juledag" => "12/26",
"Nyttårsaften" => "#31.12" # sometimes half a day off
};
## Thanks to:
## Sercan Uslu <sercanuslu@su.sabanciuniv.edu>
#
#$Profiles->{'TR'} = # Türkiye
#{
## National Public Holidays (fixed):
#
# "New Year's Day" => "01-01",
# "National Sovereignty Day" => "23-04",
# "Children's Day" => "23-04",
# "Atatürk Commemoration" => "19-05",
# "Youth and Sports Day" => "19-05",
# "Victory Day" => "30-08",
# "Republic Day" => "29-10",
#
## Religious Public Holidays (moving):
#
# "Kurban Bayram (Eid al Adha) 1" => "22-02", # only valid in 2002
# "Kurban Bayram (Eid al Adha) 2" => "23-02", # only valid in 2002
# "Kurban Bayram (Eid al Adha) 3" => "24-02", # only valid in 2002
# "Kurban Bayram (Eid al Adha) 4" => "25-02", # only valid in 2002
#
# "Ramazan / Seker Bayram (Eid al Fitr) 1" => "05-12", # only valid in 2002
# "Ramazan / Seker Bayram (Eid al Fitr) 2" => "06-12", # only valid in 2002
# "Ramazan / Seker Bayram (Eid al Fitr) 3" => "07-12" # only valid in 2002
#};
# Thanks to:
# Jonathan Stowe <gellyfish@gellyfish.com>
$Profiles->{'GB'} = # Great Britain
{
"New Year's Day" => \&GB_New_Year,
"Good Friday" => "-2",
"Easter Sunday" => "+0",
"Easter Monday" => "+1",
"Early May Bank Holiday" => \&GB_Early_May,
"Late May Bank Holiday" => "5/Mon/May", # Last Monday
#
# Jonathan Stowe <gellyfish@gellyfish.com> told me that spring
# bank holiday is the first Monday after Whitsun, but my pocket
# calendar suggests otherwise. I decided to follow my pocket
# guide and an educated guess ;-), but please correct me if
# I'm wrong!
#
"Summer Bank Holiday" => "5/Mon/Aug", # Last Monday
"Christmas Day" => \&GB_Christmas,
"Boxing Day" => \&GB_Boxing
};
sub GB_New_Year
{
my($year,$label) = @_;
return( &Next_Monday($year,1,1) );
}
#
# The following formula (also from Jonathan Stowe <gellyfish@gellyfish.com>)
# also contradicts my pocket calendar, but for lack of a better guess I
# left it as it is. Please tell me the correct formula in case this one
# is wrong! Thank you!
#
sub GB_Early_May # May bank holiday is the first Monday after May 1st
{
my($year,$label) = @_;
if (Day_of_Week($year,5,1) == 1)
{ return( Nth_Weekday_of_Month_Year($year,5,1,2) ); }
else
{ return( Nth_Weekday_of_Month_Year($year,5,1,1) ); }
}
sub GB_Christmas
{
my($year,$label) = @_;
return( &Next_Monday($year,12,25) );
}
sub GB_Boxing
{
my($year,$label) = @_;
return( &Next_Monday_or_Tuesday($year,12,26) );
}
# Thanks to:
# Bianca Taylor <bianca@unisolve.com.au>
# Andie Posey <andie@posey.org>
# Don Simonetta <don.simonetta@tequinox.com>
# Paul Fenwick <pjf@cpan.org>
# Brian Graham <brian.graham@nec.com.au>
# Pat Waters <pat.waters@dir.qld.gov.au>
# Stephen Riehm <Stephen.Riehm@gmx.net>
# http://www.holidayfestival.com/Australia.html
# http://www.earthcalendar.net/countries/2001/australia.html
# Sven Geisler <sgeisler@aeccom.com>
# Canberra (ACT):
# http://www.workcover.act.gov.au/labourreg/publicholidays.html
# New South Wales (NSW):
# http://www.dir.nsw.gov.au/holidays/index.html
# Northern Territory (NT):
# http://www.nt.gov.au/ocpe/documents/public-holidays/
# Queensland (QLD):
# http://www.wageline.qld.gov.au/publicholidays/list_pubhols.html
# South Australia (SA):
# http://www.sacentral.sa.gov.au/information/pubhols.htm
# Tasmania (TAS):
# http://www.workcover.tas.gov.au/WSTPublish/node/wststatutory.htm
# Victoria (VIC):
# http://www.info.vic.gov.au/resources/publichols.htm
# Western Australia (WA):
# http://www.doplar.wa.gov.au/wages/pub_hol1.htm
$Profiles->{'AU'} = # Australia
{
"Australia Day" => \&AU_Australia,
"St. Valentine's Day" => "#14.02.",
"Good Friday" => "-2",
"Easter Sunday" => "+0",
"Easter Monday" => "+1",
"Anzac Day" => "25.04.",
"Christmas Day" => \&AU_Christmas,
"Boxing Day" => \&AU_Boxing
};
lib/Date/Calendar/Profiles.pm view on Meta::CPAN
}
sub AU_New_Year
{
my($year,$label) = @_;
return( &Next_Monday($year,1,1) );
}
sub AU_Lauceston
{
my($year,$label) = @_;
if (Nth_Weekday_of_Month_Year($year,2,3,5))
{ return( Nth_Weekday_of_Month_Year($year,2,3,4) ); }
else
{ return( Nth_Weekday_of_Month_Year($year,2,3,3) ); }
}
sub AU_May
{
my($year,$label) = @_;
return( &Next_Monday($year,5,1) );
}
sub AU_QLD_Anzac
{
my($year,$label) = @_;
return( &Sunday_to_Monday($year,4,25) );
}
sub AU_QLD_Brisbane
{
my($year,$label) = @_;
if (Nth_Weekday_of_Month_Year($year,8,3,5))
{ return( Nth_Weekday_of_Month_Year($year,8,3,3), '#' ); }
else
{ return( Nth_Weekday_of_Month_Year($year,8,3,2), '#' ); }
}
sub AU_VIC_New_Year
{
my($year,$label) = @_;
return( &Sunday_to_Monday($year,1,1) );
}
sub AU_VIC_Boxing
{
my($year,$label) = @_;
return( &Sunday_to_Monday($year,12,26) );
}
$Profiles->{'AU-QLD'} = # Queensland
{
%{$Profiles->{'AU'}},
"New Year's Day" => "01.01.",
"Anzac Day" => \&AU_QLD_Anzac,
"Easter Saturday" => "-1",
"Labour Day" => "1/Mon/May",
"Queen's Birthday" => "2/Mon/Jun",
"Royal Show (Brisbane)" => \&AU_QLD_Brisbane
};
$Profiles->{'AU-TAS'} = # Tasmania
{
%{$Profiles->{'AU'}},
"New Year's Day" => "01.01.",
"Regatta Day" => "2/Tue/Feb",
"Lauceston Cup Day" => \&AU_Lauceston,
"King Island Show Day" => "1/Tue/Mar", # uncertain! (maybe Tuesday after 1/Sun/Mar?)
"Eight Hour Day" => "2/Mon/Mar", # dubious, formula probably wrong!
"Easter Saturday" => "-1",
"Queen's Birthday" => "2/Mon/Jun",
"Recreation Day" => "1/Mon/Nov" # only North Tasmania - date not confirmed!
};
$Profiles->{'AU-SA'} = # South Australia
{
%{$Profiles->{'AU'}},
"New Year's Day" => "01.01.",
"Easter Saturday" => "-1",
"Adelaide Cup Day" => "3/Mon/May", # uncertain! (maybe Monday after 3/Sun/May?)
"Queen's Birthday" => "2/Mon/Jun",
"Labour Day" => "1/Mon/Oct",
"Proclamation Day" => "#26.12."
};
$Profiles->{'AU-WA'} = # Western Australia
{
%{$Profiles->{'AU'}},
"New Year's Day" => "01.01.",
"Labour Day" => "1/Mon/Mar",
"Foundation Day" => "1/Mon/Jun",
"Queen's Birthday" => "1/Mon/Oct"
};
$Profiles->{'AU-ACT'} = # Australian Capital Territory
{
%{$Profiles->{'AU'}},
"New Year's Day" => "01.01.",
"Canberra Day" => "2/Mon/Mar", # dubious, formula probably wrong!
"Easter Saturday" => "-1",
"Queen's Birthday" => "2/Mon/Jun",
"Labour Day" => "1/Mon/Oct"
};
$Profiles->{'AU-NSW'} = # New South Wales
{
%{$Profiles->{'AU'}},
"New Year's Day" => \&AU_New_Year,
"Easter Saturday" => "-1",
"Queen's Birthday" => "2/Mon/Jun",
"Labour Day" => "1/Mon/Oct"
};
$Profiles->{'AU-NT'} = # Northern Territory
{
%{$Profiles->{'AU'}},
"New Year's Day" => "01.01.",
"Easter Saturday" => "-1",
"May Day" => \&AU_May,
"Queen's Birthday" => "2/Mon/Jun",
"Picnic Day" => "1/Mon/Aug"
};
$Profiles->{'AU-VIC'} = # Victoria
{
%{$Profiles->{'AU'}},
"New Year's Day" => \&AU_VIC_New_Year,
"Australia Day" => "26.01.",
"Labour Day" => "2/Mon/Mar",
"Queen's Birthday" => "2/Mon/Jun",
"Melbourne Cup Day" => "#1/Tue/Nov", # only in metropolitian municipal districts
"Christmas Day" => "25.12.",
"Boxing Day" => \&AU_VIC_Boxing
};
# Thanks to:
# John Bolland <jbolland@mainzeal.co.nz>
# Andie Posey <andie@posey.org>
$Profiles->{'NZ'} = # New Zealand
{
"New Year's Day" => \&NZ_New_Year,
"Day after New Year's Day" => \&NZ_After_New_Year,
"Waitangi Day" => "06.02.",
"St. Valentine's Day" => "#14.02.",
"St. David's Day" => "#01.03.",
"St. Patrick's Day" => "#17.03.",
"St. George's Day" => "#23.04.",
"St. Andrew's Day" => "#30.11.",
"Good Friday" => "-2",
"Easter Sunday" => "+0",
"Easter Monday" => "+1",
"Anzac Day" => "25.04.",
"Queen's Birthday" => "1/Mon/Jun",
"Labour Day" => \&NZ_Labour,
"Christmas Day" => \&NZ_Christmas,
"Boxing Day" => \&NZ_Boxing,
"Southland" => \&NZ_Southland,
"Wellington" => \&NZ_Wellington,
"Auckland" => \&NZ_Auckland,
"Taranaki" => \&NZ_Taranaki,
"Otago" => \&NZ_Otago,
( run in 0.551 second using v1.01-cache-2.11-cpan-437f7b0c052 )