Permalink
Browse files

Implement all SA holidays

git-svn-id: http://svn.php.net/repository/pear/packages/Date_Holidays/trunk@321696 c90b9560-bf6c-de11-be94-00142212c4b1
  • Loading branch information...
CloCkWeRX committed Jan 2, 2012
1 parent 32b2b54 commit bffaec74fd2340b7616b0b514c6d043785febfb3
Showing with 68 additions and 2 deletions.
  1. +68 −2 Date/Holidays/Driver/AustraliaSA.php
@@ -4,6 +4,8 @@
* This file contains only the Driver class for determining holidays in South
* Australia.
*
+ * @see http://www.safework.sa.gov.au/show_page.jsp?id=2483
+ *
* PHP Version 4
*
* Copyright (c) 1997-2008 The PHP Group
@@ -63,12 +65,76 @@ function _buildHolidays()
*/
$labourDay = Date_Calc::nWeekdayOfMonth(1, 1, 10, $this->_year);
$this->_addHoliday('labourDay', $labourDay, "Labour Day");
+ $this->_addTranslationForHoliday('labourDay', 'en_EN', 'Labour Day');
/*
* See http://en.wikipedia.org/wiki/Queen%27s_Official_Birthday#Australia
*/
- $foundationDay = Date_Calc::nWeekdayOfMonth(2, 1, 6, $this->_year);
- $this->_addHoliday('queensBirthday', $foundationDay, "Queen's Birthday");
+ $queensBirthday = Date_Calc::nWeekdayOfMonth(2, 1, 6, $this->_year);
+ $this->_addHoliday('queensBirthday', $queensBirthday, "Queen's Birthday");
+ $this->_addTranslationForHoliday('queensBirthday', 'en_EN', "Queen's Birthday");
+
+ $volunteersDay = Date_Calc::nWeekdayOfMonth(2, 1, 6, $this->_year);
+ $this->_addHoliday('volunteersDay', $volunteersDay, "Volunteer's Day");
+ $this->_addTranslationForHoliday('volunteersDay', 'en_EN', "Volunteer's Day");
+
+ /**
+ * Christmas and Boxing Day
+ */
+ $christmasDay = new Date($this->_year . '-12-25');
+ if ($christmasDay->getDayOfWeek() == 6) {
+ // 25 December - if that date falls on a Saturday the public holiday transfers to the following Monday.
+ $this->_addHoliday('christmasDay',
+ $this->_year . '-12-27',
+ 'Substitute Bank Holiday in lieu of Christmas Day');
+
+ } else if ($christmasDay->getDayOfWeek() == 0) {
+ // If that date falls on a Sunday that day and the following Monday will be public holidays.
+ $this->_addHoliday('christmasDay',
+ $this->_year . '-12-26',
+ 'Substitute Bank Holiday in lieu of Christmas Day');
+ } else {
+ $this->_addHoliday('christmasDay', $christmasDay, 'Christmas Day');
+ }
+
+
+ $proclamationDay = new Date($this->_year . '-12-26');
+ if ($proclamationDay->getDayOfWeek() == 6) {
+ //26 December - if that date falls on a Saturday the public holiday transfers to the following Monday.
+ $this->_addHoliday('proclamationDay',
+ $this->_year . '-12-28',
+ 'Substitute Bank Holiday in lieu of Proclamation Day');
+ } else if ($proclamationDay->getDayOfWeek() == 0) {
+ // If that date falls on a Sunday that day and the following Tuesday will be public holidays.
+ $this->_addHoliday('proclamationDay',
+ $this->_year . '-12-28',
+ 'Substitute Bank Holiday in lieu of Proclamation Day');
+ } else if ($proclamationDay->getDayOfWeek() == 1) {
+ // If that date falls on a Monday that day and the following Tuesday will be public holidays.
+ $this->_addHoliday('proclamationDay',
+ $this->_year . '-12-26',
+ 'Substitute Bank Holiday in lieu of Proclamation Day');
+ $this->_addHoliday('proclamationDay',
+ $this->_year . '-12-27',
+ 'Substitute Bank Holiday in lieu of Proclamation Day');
+ } else {
+ $this->_addHoliday('proclamationDay', $this->_year . '-12-26', 'Proclamation Day');
+ }
+
+ $this->_addTranslationForHoliday('christmasDay', 'en_EN', 'Christmas Day');
+ $this->_addTranslationForHoliday('proclamationDay', 'en_EN', 'Proclamation Day');
+
+
+ //The Holidays Act 1910 provides for the third Monday in May to be a public holiday.
+ if ($this->_year < 2006) {
+ $adelaideCup = Date_Calc::nWeekdayOfMonth(3, 1, 5, $this->_year);
+ } else {
+ // Since 2006, on a trial basis, this public holiday has been observed on the second Monday in March through the issuing of a special Proclamation by the Governor.
+ $adelaideCup = Date_Calc::nWeekdayOfMonth(2, 1, 3, $this->_year);
+ }
+
+ $this->_addHoliday('adelaideCup', $adelaideCup, 'Adelaide Cup');
+ $this->_addTranslationForHoliday('adelaideCup', 'en_EN', 'Adelaide Cup');
} // _buildHolidays()

0 comments on commit bffaec7

Please sign in to comment.