コード例 #1
0
 /**
  * Build the internal arrays that contain data about the calculated holidays
  *
  * @access   protected
  * @return   boolean true on success, otherwise a PEAR_ErrorStack object
  * @throws   object PEAR_ErrorStack
  */
 function _buildHolidays()
 {
     parent::_buildHolidays();
     // We need a few specific christian holidays
     // before clearing the list of holidays
     $ashWednesdayDate = $this->getHolidayDate('ashWednesday');
     $greenThursday = $this->getHolidayDate('greenThursday');
     $goodFridayDate = $this->getHolidayDate('goodFriday');
     $this->_clearHolidays();
     $this->_addHoliday('newYearsDay', $this->_year . '-01-01', 'New Year\'s Day');
     $this->_addTranslationForHoliday('newYearsDay', 'es_VE', 'Año Nuevo');
     // carnaval
     $carnival = new Date($ashWednesdayDate);
     $carnival = $carnival->getPrevDay();
     $this->_addHoliday('carnival2', $carnival, 'Carnival');
     $carnival = $carnival->getPrevDay();
     $this->_addHoliday('carnival1', $carnival, 'Carnival');
     $this->_addTranslationForHoliday('carnival1', 'es_VE', 'Carnaval');
     $this->_addTranslationForHoliday('carnival2', 'es_VE', 'Carnaval');
     // semana santa
     $this->_addHoliday('holyweek1', $greenThursday, 'Holy Week');
     $this->_addHoliday('holyweek2', $goodFridayDate, 'Holy Week');
     $this->_addTranslationForHoliday('holyweek1', 'es_VE', 'Semana Santa');
     $this->_addTranslationForHoliday('holyweek2', 'es_VE', 'Semana Santa');
     $this->_addHoliday('independenceMovementDay', $this->_year . '-04-19', 'Independence Declaration');
     $this->_addTranslationForHoliday('independenceMovementDay', 'es_VE', 'Declaración de Independencia');
     $this->_addHoliday('laborDay', $this->_year . '-05-01', 'Labor Day');
     $this->_addTranslationForHoliday('laborDay', 'es_VE', 'Día del Trabajador');
     $this->_addHoliday('battleOfCarabobo', $this->_year . '-06-24', 'Battle of Carabobo');
     $this->_addTranslationForHoliday('battleOfCarabobo', 'es_VE', 'Día de la Batalla de Carabobo');
     $this->_addHoliday('independenceDay', $this->_year . '-07-05', 'Independence Day');
     $this->_addTranslationForHoliday('independenceDay', 'es_VE', 'Día de Independencia');
     $this->_addHoliday('bolivarBirthday', $this->_year . '-07-24', 'Birthday of Simon Bolivar');
     $this->_addTranslationForHoliday('bolivarBirthday', 'es_VE', 'Natalicio de Simón Bolívar');
     $this->_addHoliday('columbosDay', $this->_year . '-10-12', 'Columbos Day');
     $this->_addTranslationForHoliday('columbosDay', 'es_VE', 'Día de la Raza');
     $this->_addHoliday('christmas', $this->_year . '-12-25', 'Christmas');
     $this->_addTranslationForHoliday('christmas', 'es_VE', 'Navidad');
     return true;
 }
コード例 #2
0
 /**
  * Calculates the date for Easter. Actually this methods delegates the
  * calculation to the {@link Date_Holidays_Driver_Christian#calcEaster()} method.
  *
  * @param int $year year
  *
  * @static
  * @access   private
  * @return   object Date
  */
 function calcEaster($year)
 {
     return Date_Holidays_Driver_Christian::calcEaster($year);
 }
コード例 #3
0
 /**
  * Build the internal arrays that contain data about the calculated holidays
  *
  * @access   protected
  * @return   boolean true on success, otherwise a PEAR_ErrorStack object
  * @throws   object PEAR_ErrorStack
  */
 function _buildHolidays()
 {
     /**
      * New Year's Day
      */
     $this->_addHoliday('newYearsDay', $this->_year . '-01-01', 'Ano Novo');
     /**
      * Epiphanias
      */
     $this->_addHoliday('epiphany', $this->_year . '-01-06', 'Dia de Reis');
     /**
      * Valentine Day
      */
     $this->_addHoliday('valentinesDay', $this->_year . '-02-14', 'Dia dos Namorados');
     /**
      * Easter Sunday
      */
     $easterDate = Date_Holidays_Driver_Christian::calcEaster($this->_year);
     $this->_addHoliday('easter', $easterDate, 'Páscoa');
     /**
      * Carnival
      */
     $carnival = $this->_addDays($easterDate, -47);
     $this->_addHoliday('carnival', $carnival, 'Carnaval');
     /**
      * Ash Wednesday
      */
     $ashWednesday = $this->_addDays($easterDate, -46);
     $this->_addHoliday('ashWednesday', $ashWednesday, 'Quarta-feira de Cinzas');
     /**
      * Palm Sunday
      */
     $palmSunday = $this->_addDays($easterDate, -7);
     $this->_addHoliday('palmSunday', $palmSunday, 'Dia de Ramos');
     /**
      * Maundy Thursday
      */
     $maundyThursday = $this->_addDays($easterDate, -3);
     $this->_addHoliday('maundyThursday', $maundyThursday, 'Quinta-feira Santa');
     /**
      * Good Friday
      */
     $goodFriday = $this->_addDays($easterDate, -2);
     $this->_addHoliday('goodFriday', $goodFriday, 'Sexta-feira Santa');
     /**
      * Easter Monday
      */
     $this->_addHoliday('easterMonday', $easterDate->getNextDay(), 'Segunda de Páscoa');
     /**
      * Fathers Day
      */
     $this->_addHoliday('fathersDay', $this->_year . '-03-19', 'Dia do Pai');
     /**
      * Liberty Day (In 25 April 1974 - Revolution of the Carnations)
      */
     $this->_addHoliday('libertyDayPortugal', $this->_year . '-04-25', 'Dia da Liberdade');
     /**
      * Day of Work
      */
     $this->_addHoliday('dayOfWork', $this->_year . '-05-01', 'Dia do Trabalhador');
     /**
      * Portugal National Day
      * (In 1580 - Day of the death of Luís Vaz de Camões poet)
      */
     $this->_addHoliday('nationalDayPortugal', $this->_year . '-06-10', 'Dia de Portugal');
     /**
      * Mothers Day
      */
     $mothersDay = $this->_calcFirstMonday("05");
     $mothersDay = $mothersDay->getPrevDay();
     $mothersDay = $this->_addDays($mothersDay, 7);
     $this->_addHoliday('mothersDay', $mothersDay, 'Dia da Mãe');
     /**
      * Ascension Day
      */
     $ascensionDate = $this->_addDays($easterDate, 39);
     $this->_addHoliday('ascensionDate', $ascensionDate, 'Dia da Ascensão');
     /**
      * Whitsun (determines Whit Monday, Ascension Day and
      * Feast of Corpus Christi)
      */
     $whitsunDate = $this->_addDays($easterDate, 49);
     $this->_addHoliday('whitsun', $whitsunDate, 'Pentecostes');
     /**
      * Whit Monday
      */
     $this->_addHoliday('whitMonday', $whitsunDate->getNextDay(), 'Segunta-feira de Pentecostes');
     /**
      * Corpus Christi
      */
     $corpusChristi = $this->_addDays($easterDate, 60);
     $this->_addHoliday('corpusChristi', $corpusChristi, 'Corpo de Deus');
     /**
      * Ascension of Maria
      */
     $this->_addHoliday('mariaAscension', $this->_year . '-08-15', 'Assunção de Maria');
     /**
      * Republic Day (In 1910 - End of Monarchy)
      */
     $this->_addHoliday('republicDayPortugal', $this->_year . '-10-05', 'Implantação da República');
     /**
      * All Saints' Day
      */
     $this->_addHoliday('allSaintsDay', $this->_year . '-11-01', 'Todos os Santos');
     /**
      * All Souls Day TODO
      */
     $this->_addHoliday('allSoulsDay', $this->_year . '-11-02', 'Allerseelen');
     /**
      * Portugal independence day (In 1640)
      */
     $this->_addHoliday('independenceOfPortugal', $this->_year . '-12-01', 'Restauração da Independência');
     /**
      * Santa Claus
      */
     $this->_addHoliday('santasDay', $this->_year . '-12-06', 'Dia de S. Nicolau');
     /**
      * Immaculate Conception
      */
     $this->_addHoliday('immaculateConceptionDay', $this->_year . '-12-08', 'Imaculada Conceição');
     /**
      * Sunday in commemoration of the dead (sundayIcotd) TODO
      */
     $sundayIcotd = $this->_calcFirstMonday(12);
     $sundayIcotd = $this->_addDays($this->_calcFirstMonday(12), -8);
     $this->_addHoliday('sundayIcotd', $sundayIcotd, 'Totensonntag');
     /**
      * 1. Advent
      */
     $firstAdv = $this->_calcFirstMonday(12);
     $firstAdv = $firstAdv->getPrevDay();
     $this->_addHoliday('firstAdvent', $firstAdv, '1. Advento');
     /**
      * 2. Advent
      */
     $secondAdv = $this->_addDays($firstAdv, 7);
     $this->_addHoliday('secondAdvent', $secondAdv, '2. Advento');
     /**
      * 3. Advent
      */
     $thirdAdv = $this->_addDays($firstAdv, 14);
     $this->_addHoliday('thirdAdvent', $thirdAdv, '3. Advento');
     /**
      * 4. Advent
      */
     $fourthAdv = $this->_addDays($firstAdv, 21);
     $this->_addHoliday('fourthAdvent', $fourthAdv, '4. Advento');
     /**
      * Christmas Eve
      */
     $this->_addHoliday('christmasEve', $this->_year . '-12-24', 'Consoada');
     /**
      * Christmas day
      */
     $this->_addHoliday('christmasDay', $this->_year . '-12-25', 'Natal');
     /**
      * New Year´s Eve
      */
     $this->_addHoliday('newYearsEve', $this->_year . '-12-31', 'Véspera de Ano Novo');
     if (Date_Holidays::errorsOccurred()) {
         return Date_Holidays::getErrorStack();
     }
     return true;
 }
コード例 #4
0
 /**
  * Build the internal arrays that contain data about the calculated holidays
  *
  * @access   protected
  * @return   boolean true on success, otherwise a PEAR_ErrorStack object
  * @throws   object PEAR_ErrorStack
  */
 function _buildHolidays()
 {
     parent::_buildHolidays();
     $ashWednesdayDate = $this->getHolidayDate('ashWednesday');
     $this->_addTranslationForHoliday('easter', 'pt_BR', 'Páscoa');
     $this->_addTranslationForHoliday('ashWednesday', 'pt_BR', 'Quarta-Feira de Cinzas');
     $this->_addTranslationForHoliday('goodFriday', 'pt_BR', 'Sexta-Feira Santa');
     $this->_addTranslationForHoliday('corpusChristi', 'pt_BR', 'Corpus Christi');
     $this->_addTranslationForHoliday('thanksGiving', 'pt_BR', 'Dia de Ação de Graças');
     $this->_addTranslationForHoliday('allSoulsDay', 'pt_BR', 'Dia de Finados');
     $this->_addTranslationForHoliday('christmasDay', 'pt_BR', 'Natal');
     /**
      * New Year's Day
      */
     $this->_addHoliday('newYearsDay', $this->_year . '-01-01', 'New Year\'s Day');
     $this->_addTranslationForHoliday('newYearsDay', 'pt_BR', 'Ano Novo');
     /**
      * Carnival
      */
     $carnival = new Date($ashWednesdayDate);
     $carnival = $carnival->getPrevDay();
     $this->_addHoliday('carnival', $carnival, 'Carnival');
     $this->_addTranslationForHoliday('carnival', 'pt_BR', 'Carnaval');
     /**
      * International Women's Day
      */
     $this->_addHoliday('womensDay', $this->_year . '-03-08', 'International Women\'s Day');
     $this->_addTranslationForHoliday('womensDay', 'pt_BR', 'Dia Internacional das Mulheres');
     /**
      * Tiradentes
      */
     $this->_addHoliday('tiradentesDay', $this->_year . '-04-21', 'Tiradentes\' Day');
     $this->_addTranslationForHoliday('tiradentesDay', 'pt_BR', 'Dia de Tiradentes');
     /**
      * Labor Day
      */
     $this->_addHoliday('laborDay', $this->_year . '-05-01', 'Labor Day');
     $this->_addTranslationForHoliday('laborDay', 'pt_BR', 'Dia do Trabalho');
     /**
      * Mothers' Day
      */
     $mothersDay = $this->_calcNthWeekDayInMonth(2, 0, 5);
     $this->_addHoliday('mothersDay', $mothersDay, 'Mothers\' Day');
     $this->_addTranslationForHoliday('mothersDay', 'pt_BR', 'Dia das Mães');
     /**
      * Valentine's Day
      */
     $this->_addHoliday('valentinesDay', $this->_year . '-06-12', 'Valentine\'s Day');
     $this->_addTranslationForHoliday('valentinesDay', 'pt_BR', 'Dia dos Namorados');
     /**
      * Fathers' Day
      */
     $fathersDay = $this->_calcNthWeekDayInMonth(2, 0, 8);
     $this->_addHoliday('fathersDay', $fathersDay, 'Fathers\' Day');
     $this->_addTranslationForHoliday('fathersDay', 'pt_BR', 'Dia dos Pais');
     /**
      * Independence Day
      */
     $this->_addHoliday('independenceDay', $this->_year . '-09-07', 'Independece Day');
     $this->_addTranslationForHoliday('independenceDay', 'pt_BR', 'Dia da Independência');
     /**
      * Aparecida
      */
     $this->_addHoliday('aparecidaDay', $this->_year . '-10-12', 'Our Lady of Aparecida Day');
     $this->_addTranslationForHoliday('aparecidaDay', 'pt_BR', 'Dia de Nossa Senhora de Aparecida');
     /**
      * Children' Day
      */
     $this->_addHoliday('childrenDay', $this->_year . '-10-12', 'Children\'s Day');
     $this->_addTranslationForHoliday('childrenDay', 'pt_BR', 'Dia das Crianças');
     /**
      * Proclamation of the Republic
      */
     $this->_addHoliday('republicDay', $this->_year . '-11-15', 'Proclamation of the Republic');
     $this->_addTranslationForHoliday('republicDay', 'pt_BR', 'Proclamação da República');
     if (Date_Holidays::errorsOccurred()) {
         return Date_Holidays::getErrorStack();
     }
     return true;
 }
コード例 #5
0
 /**
  * Build the internal arrays that contain data about the calculated holidays
  *
  * @access	 protected
  * @return	 boolean true on success, otherwise a PEAR_ErrorStack object
  * @throws	 object PEAR_ErrorStack
  */
 function _buildHolidays()
 {
     parent::_buildHolidays();
     /**
      * New Year's Day
      */
     $this->_addHoliday('newYearsDay', $this->_year . '-01-01', 'New Year\'s Day');
     /**
      * Epiphanias
      */
     $firstSunday = $this->_calcNthWeekDayInMonth(1, 0, 1);
     if ($firstSunday->getDay() == 1) {
         $firstSunday = $this->_addDays($firstSunday, 7);
     }
     $this->_addHoliday('epiphanySunday', $firstSunday, 'Epiphany');
     /**
      * Valentine's Day
      */
     $this->_addHoliday('valentinesDay', $this->_year . '-02-14', 'Valentine\'s Day');
     /**
      * Easter Sunday
      */
     $easterDate = $this->getHolidayDate('easter');
     /**
      * Shrove Monday
      */
     $shroveMondayDate = $this->_addDays($easterDate, -48);
     $this->_addHoliday('shroveMonday', $shroveMondayDate, 'Shrove Monday');
     /**
      * Shrove Tuesday
      */
     $shroveTuesdayDate = $this->_addDays($shroveMondayDate, 1);
     $this->_addHoliday('shroveTuesday', $shroveTuesdayDate, 'Shrove Tuesday');
     /**
      * International day of work
      */
     $this->_addHoliday('dayOfWork', $this->_year . '-05-01', 'International day of work');
     /**
      * 1945 victory
      */
     $this->_addHoliday('victory1945', $this->_year . '-05-08', 'Victory of 1945');
     /**
      * Mother's Day
      */
     $mothersDay = $this->_calcLastSunday(5);
     $whitsun = $this->getHolidayDate('whitsun');
     $mothersDay2 = new Date($mothersDay);
     if ($mothersDay2->equals(clone $whitsun)) {
         $mothersDay = $this->_addDays($mothersDay, 7);
     }
     $this->_addHoliday('mothersDay', $mothersDay, 'Mothers\' Day');
     /**
      * Abolition of Slavery Day (Mayotte)
      */
     $this->_addHoliday('abolitionOfSlaveryDayMayotte', $this->_year . '-04-27', 'Abolition of Slavery Day');
     /**
      * Saint-Pierre-Chanel Day (Wallis and Futuna)
      */
     $this->_addHoliday('saintPierreChanelDay', $this->_year . '-04-28', 'Saint-Pierre-Chanel Day');
     /**
      * Abolition of Slavery Day (Martinique)
      */
     $this->_addHoliday('abolitionOfSlaveryDayMartinique', $this->_year . '-05-22', 'Abolition of Slavery Day');
     /**
      * Abolition of Slavery Day (Guadeloupe)
      */
     $this->_addHoliday('abolitionOfSlaveryDayGuadeloupe', $this->_year . '-05-27', 'Abolition of Slavery Day');
     /**
      * Abolition of Slavery Day (Guyana)
      */
     $this->_addHoliday('abolitionOfSlaveryDayGuyana', $this->_year . '-06-10', 'Abolition of Slavery Day');
     /**
      * Autonomy Day (French Polynesia)
      */
     $this->_addHoliday('autonomyDay', $this->_year . '-06-29', 'Autonomy Day');
     /**
      * French National Day
      */
     $this->_addHoliday('frenchNationalDay', $this->_year . '-07-14', 'French National Day');
     /**
      * Victor Schoelcher Day
      */
     $this->_addHoliday('victorSchoelcherDay', $this->_year . '-07-21', 'Victor Schoelcher Day');
     /**
      * Territory Day (Wallis and Futuna)
      */
     $this->_addHoliday('territoryDay', $this->_year . '-07-29', 'Territory Day');
     /**
      * Celebration of citizenship Day (New Caledonia)
      */
     $this->_addHoliday('celebrationOfCitizenshipDay', $this->_year . '-09-24', 'Celebration of citizenship Day');
     /**
      * Veteran's	Day
      */
     $this->_addHoliday('veteransDay', $this->_year . '-11-11', 'Veteran\'s Day');
     /**
      * Abolition of Slavery Day (Reunion)
      */
     $this->_addHoliday('abolitionOfSlaveryDayReunion', $this->_year . '-12-20', 'Abolition of Slavery Day');
     /**
      * Saint Étienne Day(Alsace & Moselle)
      */
     $this->_addHoliday('saintEtienneDay', $this->_year . '-12-26', 'Saint Étienne Day');
     if (Date_Holidays::errorsOccurred()) {
         return Date_Holidays::getErrorStack();
     }
     return true;
 }
コード例 #6
0
 /**
  * Build the internal arrays that contain data about the calculated holidays
  *
  * @access   protected
  * @return   boolean true on success, otherwise a PEAR_ErrorStack object
  * @throws   object PEAR_ErrorStack
  */
 function _buildHolidays()
 {
     /**
      * New Year's Day
      */
     $this->_addHoliday('newYearsDay', $this->_year . '-01-01', 'Neujahr');
     /**
      * Epiphanias
      */
     $this->_addHoliday('epiphany', $this->_year . '-01-06', 'Heilige Drei Könige');
     /**
      * Valentine´s Day
      */
     $this->_addHoliday('valentinesDay', $this->_year . '-02-14', 'Valentinstag');
     /**
      * Easter Sunday
      */
     $easterDate = Date_Holidays_Driver_Christian::calcEaster($this->_year);
     $this->_addHoliday('easter', $easterDate, 'Ostersonntag');
     /**
      * Ash Wednesday
      */
     $ashWednesday = $this->_addDays($easterDate, -46);
     $this->_addHoliday('ashWednesday', $ashWednesday, 'Aschermittwoch');
     /**
      * Palm Sunday
      */
     $palmSunday = $this->_addDays($easterDate, -7);
     $this->_addHoliday('palmSunday', $palmSunday, 'Palmsonntag');
     /**
      * Maundy Thursday
      */
     $maundyThursday = $this->_addDays($easterDate, -3);
     $this->_addHoliday('maundyThursday', $maundyThursday, 'Gründonnerstag');
     /**
      * Good Friday
      */
     $goodFriday = $this->_addDays($easterDate, -2);
     $this->_addHoliday('goodFriday', $goodFriday, 'Karfreitag');
     /**
      * Easter Monday
      */
     $this->_addHoliday('easterMonday', $easterDate->getNextDay(), 'Ostermontag');
     /**
      * Day of Work
      */
     $this->_addHoliday('dayOfWork', $this->_year . '-05-01', 'Staatsfeiertag Österreich');
     /**
      * Saint Florian
      */
     $this->_addHoliday('saintFlorian', $this->_year . '-05-04', 'St. Florian');
     /**
      * Mothers Day
      */
     $mothersDay = $this->_calcFirstMonday("05");
     $mothersDay = $mothersDay->getPrevDay();
     $mothersDay = $this->_addDays($mothersDay, 7);
     $this->_addHoliday('mothersDay', $mothersDay, 'Muttertag');
     /**
      * Ascension Day
      */
     $ascensionDate = $this->_addDays($easterDate, 39);
     $this->_addHoliday('ascensionDate', $ascensionDate, 'Christi Himmelfahrt');
     /**
      * Ascension Day
      */
     //$ascensionDayDate = new Date($whitsunDate);
     //$ascensionDayDate->subtractSpan(new Date_Span('10, 0, 0, 0'));
     //$this->_addHoliday('ascensionDay',
     //                   $ascensionDayDate,
     //                   'Christi Himmelfahrt');
     /**
      * Whitsun (determines Whit Monday, Ascension Day and
      * Feast of Corpus Christi)
      */
     $whitsunDate = $this->_addDays($easterDate, 49);
     $this->_addHoliday('whitsun', $whitsunDate, 'Pfingstsonntag');
     /**
      * Whit Monday
      */
     $this->_addHoliday('whitMonday', $whitsunDate->getNextDay(), 'Pfingstmontag');
     /**
      * Corpus Christi
      */
     $corpusChristi = $this->_addDays($easterDate, 60);
     $this->_addHoliday('corpusChristi', $corpusChristi, 'Fronleichnam');
     /**
      * Fathers Day
      */
     $fathersDay = $this->_calcFirstMonday("06");
     $fathersDay = $fathersDay->getPrevDay();
     $fathersDay = $this->_addDays($fathersDay, 7);
     $this->_addHoliday('fathersDay', $fathersDay, 'Vatertag');
     /**
      * Ascension of Maria
      */
     $this->_addHoliday('mariaAscension', $this->_year . '-08-15', 'Maria Himmelfahrt');
     /**
      * Österreichischer Nationalfeiertag
      */
     $this->_addHoliday('nationalDayAustria', $this->_year . '-10-26', 'Österreichischer Nationalfeiertag');
     /**
      * All Saints' Day
      */
     $this->_addHoliday('allSaintsDay', $this->_year . '-11-01', 'Allerheiligen');
     /**
      *All Souls´ Day
      */
     $this->_addHoliday('allSoulsDay', $this->_year . '-11-02', 'Allerseelen');
     /**
      * Santa Claus
      */
     $this->_addHoliday('santasDay', $this->_year . '-12-06', 'St. Nikolaus');
     /**
      * Immaculate Conception
      */
     $this->_addHoliday('immaculateConceptionDay', $this->_year . '-12-08', 'Maria Empfängnis');
     /**
      * Sunday in commemoration of the dead (sundayIcotd)
      */
     $sundayIcotd = $this->_calcFirstMonday(12);
     $sundayIcotd = $this->_addDays($this->_calcFirstMonday(12), -8);
     $this->_addHoliday('sundayIcotd', $sundayIcotd, 'Totensonntag');
     /**
      * 1. Advent
      */
     $firstAdv = $this->_calcFirstMonday(12);
     $firstAdv = $firstAdv->getPrevDay();
     $this->_addHoliday('firstAdvent', $firstAdv, '1. Advent');
     /**
      * 2. Advent
      */
     $secondAdv = $this->_addDays($firstAdv, 7);
     $this->_addHoliday('secondAdvent', $secondAdv, '2. Advent');
     /**
      * 3. Advent
      */
     $thirdAdv = $this->_addDays($firstAdv, 14);
     $this->_addHoliday('thirdAdvent', $thirdAdv, '3. Advent');
     /**
      * 4. Advent
      */
     $fourthAdv = $this->_addDays($firstAdv, 21);
     $this->_addHoliday('fourthAdvent', $fourthAdv, '4. Advent');
     /**
      * Christmas Eve
      */
     $this->_addHoliday('christmasEve', $this->_year . '-12-24', 'Heiliger Abend');
     /**
      * Christmas day
      */
     $this->_addHoliday('christmasDay', $this->_year . '-12-25', 'Christtag');
     /**
      * Boxing day
      */
     $this->_addHoliday('boxingDay', $this->_year . '-12-26', 'Stefanitag');
     /**
      * New Year´s Eve
      */
     $this->_addHoliday('newYearsEve', $this->_year . '-12-31', 'Silvester');
     if (Date_Holidays::errorsOccurred()) {
         return Date_Holidays::getErrorStack();
     }
     return true;
 }
コード例 #7
0
 /**
  * Build the internal arrays that contain data about the calculated holidays
  *
  * @access   protected
  * @return   boolean true on success, otherwise a PEAR_ErrorStack object
  * @throws   object PEAR_ErrorStack
  */
 function _buildHolidays()
 {
     parent::_buildHolidays();
     $easterDate = $this->getHolidayDate('easter');
     $ashWednesdayDate = $this->getHolidayDate('ashWednesday');
     $ascensionDayDate = $this->getHolidayDate('ascensionDay');
     $advent1Date = $this->getHolidayDate('advent1');
     /**
      * New Year's Day
      */
     $this->_addHoliday('newYearsDay', $this->_year . '-01-01', 'New Year\'s Day');
     /**
      * Valentine's Day
      */
     $this->_addHoliday('valentinesDay', $this->_year . '-02-14', 'Valentine\'s Day');
     /**
      * "Weiberfastnacht"
      */
     $wFasnetDate = $this->_addDays($ashWednesdayDate, -6);
     $this->_addHoliday('womenFasnet', $wFasnetDate, 'Carnival');
     /**
      * Carnival / "Fastnacht"
      */
     $fasnetDate = $this->_addDays($easterDate, -47);
     $this->_addHoliday('fasnet', $fasnetDate, 'Carnival');
     /**
      * Rose Monday
      */
     $roseMondayDate = $this->_addDays($easterDate, -48);
     $this->_addHoliday('roseMonday', $roseMondayDate, 'Rose Monday');
     /**
      * International Women's Day
      */
     $this->_addHoliday('womensDay', $this->_year . '-03-08', 'International Women\'s Day');
     /**
      * April 1st
      */
     $this->_addHoliday('april1st', $this->_year . '-04-01', 'April 1st');
     /**
      * Girls' Day (fourth Thursday in April)
      */
     $girlsDayDate = new Date($this->_year . '-04-01');
     $dayOfWeek = $girlsDayDate->getDayOfWeek();
     switch ($dayOfWeek) {
         case 0:
         case 1:
         case 2:
         case 3:
             $girlsDayDate = $this->_addDays($girlsDayDate, 4 - $dayOfWeek + 21);
             break;
         case 4:
             $girlsDayDate = $this->_addDays($girlsDayDate, 21);
             break;
         case 5:
         case 6:
             $girlsDayDate = $this->_addDays($girlsDayDate, -1 * $dayOfWeek + 11 + 21);
             break;
     }
     $this->_addHoliday('girlsDay', $girlsDayDate, 'Girls\' Day');
     /**
      * International Earth' Day
      */
     $this->_addHoliday('earthDay', $this->_year . '-04-22', 'International Earth\' Day');
     /**
      * German Beer's Day
      */
     $this->_addHoliday('beersDay', $this->_year . '-04-23', 'German Beer\'s Day');
     /**
      * Walpurgis Night
      */
     $this->_addHoliday('walpurgisNight', $this->_year . '-04-30', 'Walpurgis Night');
     /**
      * Day of Work
      */
     $this->_addHoliday('dayOfWork', $this->_year . '-05-01', 'Day of Work');
     /**
      * World's Laughing Day
      */
     $laughingDayDate = new Date($this->_year . '-05-01');
     while ($laughingDayDate->getDayOfWeek() != 0) {
         $laughingDayDate = $laughingDayDate->getNextDay();
     }
     $this->_addHoliday('laughingDay', $laughingDayDate, 'World\'s Laughing Day');
     /**
      * Europe Day
      */
     $this->_addHoliday('europeDay', $this->_year . '-05-05', 'Europe Day');
     /**
      * Mothers' Day
      */
     $mothersDay = $this->_addDays($laughingDayDate, 7);
     $this->_addHoliday('mothersDay', $mothersDay, 'Mothers\' Day');
     /**
      * End of World War 2 in Germany
      */
     $this->_addHoliday('endOfWWar2', $this->_year . '-05-08', 'End of World War 2 in Germany');
     /**
      * Fathers' Day
      */
     $this->_addHoliday('fathersDay', $ascensionDayDate, 'Fathers\' Day');
     /**
      * Amnesty International Day
      */
     $this->_addHoliday('aiDay', $this->_year . '-05-28', 'Amnesty International Day');
     /**
      * International Children' Day
      */
     $this->_addHoliday('intChildrenDay', $this->_year . '-06-01', 'International Children\'s Day');
     /**
      * Day of organ donation
      */
     $organDonationDate = new Date($this->_year . '-06-01');
     while ($organDonationDate->getDayOfWeek() != 6) {
         $organDonationDate = $organDonationDate->getNextDay();
     }
     $this->_addHoliday('organDonationDay', $organDonationDate, 'Day of organ donation');
     /**
      * Dormouse' Day
      */
     $this->_addHoliday('dormouseDay', $this->_year . '-06-27', 'Dormouse\' Day');
     /**
      * Christopher Street Day
      */
     $this->_addHoliday('christopherStreetDay', $this->_year . '-06-27', 'Christopher Street Day');
     /**
      * Hiroshima Commemoration Day
      */
     $this->_addHoliday('hiroshimaCommemorationDay', $this->_year . '-08-06', 'Hiroshima Commemoration Day');
     /**
      * Augsburg peace celebration
      */
     $this->_addHoliday('augsburgPeaceCelebration', $this->_year . '-08-08', 'Augsburg peace celebration');
     /**
      * International left-handeds' Day
      */
     $this->_addHoliday('leftHandedDay', $this->_year . '-08-13', 'International left-handeds\' Day');
     /**
      * Anti-War Day
      */
     $this->_addHoliday('antiWarDay', $this->_year . '-09-01', 'Anti-War Day');
     /**
      * Day of German Language
      */
     $germanLangDayDate = new Date($this->_year . '-09-01');
     while ($germanLangDayDate->getDayOfWeek() != 6) {
         $germanLangDayDate = $germanLangDayDate->getNextDay();
     }
     $germanLangDayDate = $this->_addDays($germanLangDayDate, 7);
     $this->_addHoliday('germanLanguageDay', $germanLangDayDate, 'Day of German Language');
     /**
      * International diabetes day
      */
     $this->_addHoliday('diabetesDay', $this->_year . '-11-14', 'International diabetes day');
     /**
      * German Unification Day
      */
     $this->_addHoliday('germanUnificationDay', $this->_year . '-10-03', 'German Unification Day');
     /**
      * Libraries' Day
      */
     $this->_addHoliday('librariesDay', $this->_year . '-10-24', 'Libraries\' Day');
     /**
      * World's Savings Day
      */
     $this->_addHoliday('savingsDay', $this->_year . '-10-30', 'World\'s Savings Day');
     /**
      * Halloween
      */
     $this->_addHoliday('halloween', $this->_year . '-10-31', 'Halloween');
     /**
      * Stamp's Day
      *
      * year <= 1948: 7th of January
      * year > 1948: last Sunday in October
      */
     $stampsDayDate = null;
     if ($this->_year <= 1948) {
         $stampsDayDate = new Date($this->_year . '-01-07');
         while ($stampsDayDate->getDayOfWeek() != 0) {
             $stampsDayDate = $stampsDayDate->getNextDay();
         }
     } else {
         $stampsDayDate = new Date($this->_year . '-10-31');
         while ($stampsDayDate->getDayOfWeek() != 0) {
             $stampsDayDate = $stampsDayDate->getPrevDay();
         }
     }
     $this->_addHoliday('stampsDay', $stampsDayDate, 'Stamp\'s Day');
     /**
      * International Men's Day
      */
     $this->_addHoliday('mensDay', $this->_year . '-11-03', 'International Men\'s Day');
     /**
      * Fall of the Wall of Berlin
      */
     $this->_addHoliday('wallOfBerlin', $this->_year . '-11-09', 'Fall of the Wall of Berlin 1989');
     /**
      * Beginning of the Carnival
      */
     $this->_addHoliday('carnivalBeginning', $this->_year . '-11-11', 'Beginning of the Carnival');
     /**
      * People's Day of Mourning
      */
     $dayOfMourning = $this->_addDays($advent1Date, -14);
     $this->_addHoliday('dayOfMourning', $dayOfMourning, 'People\'s Day of Mourning');
     if (Date_Holidays::errorsOccurred()) {
         return Date_Holidays::getErrorStack();
     }
     return true;
 }
コード例 #8
0
 /**
  * Build the internal arrays that contain data about the calculated holidays
  *
  * @access   protected
  * @return   boolean true on success, otherwise a PEAR_ErrorStack object
  * @throws   object PEAR_ErrorStack
  */
 function _buildHolidays()
 {
     /**
      * New Year's Day
      */
     $this->_addHoliday('newYearsDay', $this->_year . '-01-01', 'New Year\'s Day');
     $this->_addTranslationForHoliday('newYearsDay', 'it_IT', 'Capodanno');
     /**
      * Epiphany
      */
     $this->_addHoliday('epiphany', $this->_year . '-01-06', 'Epiphany');
     $this->_addTranslationForHoliday('epiphany', 'it_IT', 'Epifania');
     /**
      * St Agata's Day and
      * Anniversary of the Liberation from the Occupation of Cardinal Alberoni
      */
     $this->_addHoliday('stagataday', $this->_year . '-02-05', 'St Agata\'s Day');
     $this->_addTranslationForHoliday('stagataday', 'it_IT', 'Sant\'Agata');
     /**
      * Anniversary of the "Arengo"
      */
     $this->_addHoliday('arengo', $this->_year . '-03-25', 'Anniversary of the "Arengo"');
     $this->_addTranslationForHoliday('arengo', 'it_IT', 'Anniversario dell\'Arengo');
     /**
      * Investiture of the Captains Regent (Heads of  State)
      */
     $this->_addHoliday('reggentiaprile', $this->_year . '-04-01', 'Investiture of the Captains Regent (Heads of  State)');
     $this->_addTranslationForHoliday('reggentiaprile', 'it_IT', 'Ingresso Capitani Reggenti');
     /**
      * Easter Sunday
      */
     $easterDate = Date_Holidays_Driver_Christian::calcEaster($this->_year);
     $this->_addHoliday('easter', $easterDate, 'Easter Sunday');
     $this->_addTranslationForHoliday('easter', 'it_IT', 'Pasqua');
     /**
      * Easter Monday
      */
     $this->_addHoliday('easterMonday', $easterDate->getNextDay(), 'Easter Monday');
     $this->_addTranslationForHoliday('easterMonday', 'it_IT', 'Lunedi` dell\'Angelo');
     /**
      * Day of Work
      */
     $this->_addHoliday('dayOfWork', $this->_year . '-05-01', 'Day of Work');
     $this->_addTranslationForHoliday('dayOfWork', 'it_IT', 'Festa del Lavoro');
     /**
      * Corpus Domini
      */
     $corpus = $this->_addDays($easterDate, 60);
     $this->_addHoliday('corpusdomini', $corpus, 'Corpus Domini');
     $this->_addTranslationForHoliday('corpusdomini', 'it_IT', 'Corpus Domini');
     /**
      * Fall of Fascism
      */
     $this->_addHoliday('falloffascism', $this->_year . '-07-28', 'Fall of Fascism');
     $this->_addTranslationForHoliday('falloffascism', 'it_IT', 'Caduta del Fascismo');
     /**
      * Ascension of Maria
      */
     $this->_addHoliday('mariaAscension', $this->_year . '-08-15', 'Ascension of Maria');
     $this->_addTranslationForHoliday('mariaAscension', 'it_IT', 'Assunzione di Maria Vergine');
     /**
      * San Marino National Holiday and Foundation of the Republic
      */
     $this->_addHoliday('nationalholiday', $this->_year . '-09-03', 'San Marino National Holiday and Foundation of the Republic');
     $this->_addTranslationForHoliday('nationalholiday', 'it_IT', 'San Marino, festa della fondazione');
     /**
      * Investiture of the Captains Regent (Heads of  State)
      */
     $this->_addHoliday('reggentiottobre', $this->_year . '-10-01', 'Investiture of the Captains Regent (Heads of  State)');
     $this->_addTranslationForHoliday('reggentiottobre', 'it_IT', 'Ingresso Capitani Reggenti');
     /**
      * All Saints' Day
      */
     $this->_addHoliday('allSaintsDay', $this->_year . '-11-01', 'All Saints\' Day');
     $this->_addTranslationForHoliday('allSaintsDay', 'it_IT', 'Ognissanti');
     /**
      * All Souls' Day
      */
     $this->_addHoliday('allSoulsDay', $this->_year . '-11-02', 'All Souls\' Day');
     $this->_addTranslationForHoliday('allSoulsDay', 'it_IT', 'Commemorazione dei Defunti');
     /**
      * Maria' conception
      */
     $this->_addHoliday('mariaConception', $this->_year . '-12-08', 'Conception of Maria');
     $this->_addTranslationForHoliday('mariaConception', 'it_IT', 'Immacolata Concezione');
     /**
      * Christmas day
      */
     $this->_addHoliday('christmasDay', $this->_year . '-12-25', 'Christmas Day');
     $this->_addTranslationForHoliday('christmasDay', 'it_IT', 'Santo Natale');
     /**
      * St. Stephen's Day
      */
     $this->_addHoliday('StStephensDay', $this->_year . '-12-26', 'Saint Stephen\'s Day');
     $this->_addTranslationForHoliday('StStephensDay', 'it_IT', 'Santo Stefano');
     if (Date_Holidays::errorsOccurred()) {
         return Date_Holidays::getErrorStack();
     }
     return true;
 }
コード例 #9
0
 /**
  * Build the internal arrays that contain data about the calculated holidays
  *
  * @access protected
  * @return boolean true on success, otherwise a PEAR_ErrorStack object
  * @throws object PEAR_ErrorStack
  */
 function _buildHolidays()
 {
     /**
      * New Year's Day
      */
     $newYearsDay = new Date($this->_year . '-01-01');
     if ($newYearsDay->getDayOfWeek() == 0) {
         $this->_addHoliday('newYearsDay', $this->_year . '-01-02', 'Substitute Bank Holiday in lieu of New Year\'s Day');
     } elseif ($newYearsDay->getDayOfWeek() == 6) {
         $this->_addHoliday('newYearsDay', $this->_year . '-01-03', 'Substitute Bank Holiday in lieu of New Year\'s Day');
     } else {
         $this->_addHoliday('newYearsDay', $newYearsDay, 'New Year\'s Day');
     }
     /**
      * Easter Sunday
      */
     $easterDate = Date_Holidays_Driver_Christian::calcEaster($this->_year);
     /**
      * Good Friday
      */
     $goodFridayDate = new Date($easterDate);
     $goodFridayDate = $this->_addDays($easterDate, -2);
     $this->_addHoliday('goodFriday', $goodFridayDate, 'Good Friday');
     /**
      * Easter Monday
      */
     $this->_addHoliday('easterMonday', $easterDate->getNextDay(), 'Easter Monday');
     /**
      * May Day Bank Holiday
      */
     $earlyMayDate = Date_Holidays_Driver_USA::_calcNthMondayInMonth(5, 1);
     $this->_addHoliday('mayDay', $earlyMayDate, 'May Day Bank Holiday');
     /**
      * Spring Bank Holiday
      */
     $springBankDate = Date_Holidays_Driver_USA::_calcLastMondayInMonth(5);
     $this->_addHoliday('springBank', $springBankDate, 'Spring Bank Holiday');
     /**
      * Summer Bank Holiday
      */
     $summerBankDate = Date_Holidays_Driver_USA::_calcLastMondayInMonth(8);
     $this->_addHoliday('summerBank', $summerBankDate, 'Summer Bank Holiday');
     /**
      * Christmas and Boxing Day
      */
     $christmasDay = new Date($this->_year . '-12-25');
     if ($christmasDay->getDayOfWeek() == 0) {
         $this->_addHoliday('boxingDay', $this->_year . '-12-26', 'Boxing Day');
         $this->_addHoliday('christmasDay', $this->_year . '-12-27', 'Substitute Bank Holiday in lieu of Christmas Day');
     } elseif ($christmasDay->getDayOfWeek() == 5) {
         $this->_addHoliday('christmasDay', $christmasDay, 'Christmas Day');
         $this->_addHoliday('boxingDay', $this->_year . '-12-28', 'Substitute Bank Holiday in lieu of Boxing Day');
     } elseif ($christmasDay->getDayOfWeek() == 6) {
         $this->_addHoliday('christmasDay', $this->_year . '-12-28', 'Substitute Bank Holiday in lieu of Christmas Day');
         $this->_addHoliday('boxingDay', $this->_year . '-12-27', 'Substitute Bank Holiday in lieu of Boxing Day');
     } else {
         $this->_addHoliday('christmasDay', $christmasDay, 'Christmas Day');
         $this->_addHoliday('boxingDay', $this->_year . '-12-26', 'Boxing Day');
     }
     if (Date_Holidays::errorsOccurred()) {
         return Date_Holidays::getErrorStack();
     }
     return true;
 }
コード例 #10
0
 /**
  * Build the internal arrays that contain data about the calculated holidays
  *
  * @access   protected
  * @return   boolean true on success, otherwise a PEAR_ErrorStack object
  * @throws   object PEAR_ErrorStack
  */
 function _buildHolidays()
 {
     /**
      * New Year's Day
      */
     $this->_addHoliday('novagodina', $this->_year . '-01-01', 'Nova godina');
     /**
      * Sveta tri kralja
      */
     $this->_addHoliday('trikralja', $this->_year . '-01-06', 'Sveta tri kralja');
     /**
      * Easter Sunday
      */
     $easter = Date_Holidays_Driver_Christian::calcEaster($this->_year);
     $this->_addHoliday('uskrs', $easter, 'Uskrs');
     /**
      * Easter Monday
      */
     $easterMon = clone $easter;
     $easterMon->day++;
     $this->_addHoliday('uskrspon', $easterMon, 'Uskršnji ponedjeljak');
     /**
      * Praznik rada
      */
     $this->_addHoliday('rada', $this->_year . '-05-01', 'Praznik rada');
     /**
      * Tijelovo
      */
     $easterMon = clone $easter;
     $easterMon->day += 60;
     $this->_addHoliday('Tijelovo', $easterMon, 'Tijelovo');
     /**
      * Dan antifašističke borbe
      */
     $this->_addHoliday('antifasizma', $this->_year . '-06-22', 'Dan antifašističke borbe');
     /**
      * Dan državnosti
      */
     $this->_addHoliday('drzavnosti', $this->_year . '-06-25', 'Dan državnosti');
     /**
      * Dan domovinske zahvalnosti
      */
     $this->_addHoliday('zahvalnosti', $this->_year . '-08-05', 'Dan domovinske zahvalnosti');
     /**
      * Velika Gospa
      */
     $this->_addHoliday('gospa', $this->_year . '-08-15', 'Velika Gospa');
     /**
      * Dan neovisnosti
      */
     $this->_addHoliday('neovisnosti', $this->_year . '-10-08', 'Dan neovisnosti');
     /**
      * Dan svih svetih
      */
     $this->_addHoliday('svisveti', $this->_year . '-11-01', 'Dan svih svetih');
     /**
      * Božić
      */
     $this->_addHoliday('bozic', $this->_year . '-12-25', 'Božić');
     /**
      * Sveti Stjepan
      */
     $this->_addHoliday('svetistjepan', $this->_year . '-12-26', 'Sveti Stjepan');
     if (Date_Holidays::errorsOccurred()) {
         return Date_Holidays::getErrorStack();
     }
     return true;
 }
コード例 #11
0
 /**
  * Build the internal arrays that contain data about the calculated holidays
  *
  * @access   protected
  * @return   boolean true on success, otherwise a PEAR_ErrorStack object
  * @throws   object PEAR_ErrorStack
  */
 function _buildHolidays()
 {
     /**
      * New Year's Day
      */
     $this->_addHoliday('newYearsDay', $this->_year . '-01-01', 'New Year\'s Day');
     $this->_addTranslationForHoliday('newYearsDay', 'da_DK', 'Nytårsdag');
     /**
      * Epiphanias
      */
     $this->_addHoliday('epiphany', $this->_year . '-01-06', 'Epiphany');
     $this->_addTranslationForHoliday('epiphany', 'da_DK', 'Hellig 3 Konger');
     /**
      * Easter Sunday
      */
     $easterDate = Date_Holidays_Driver_Christian::calcEaster($this->_year);
     $this->_addHoliday('easter', $easterDate, 'Easter Sunday');
     $this->_addTranslationForHoliday('easter', 'da_DK', 'Påskedag');
     /**
      * Easter Monday
      */
     $this->_addHoliday('easterMonday', $easterDate->getNextDay(), 'Easter Monday');
     $this->_addTranslationForHoliday('easterMonday', 'da_DK', '2. Påskedag');
     /**
      * Palm Sunday
      */
     $palmSundayDate = $this->_addDays($easterDate, -7);
     $this->_addHoliday('palmSunday', $palmSundayDate, 'Palm Sunday');
     $this->_addTranslationForHoliday('palmSunday', 'da_DK', 'Palme Søndag');
     /**
      * Good Friday / Black Friday
      */
     $goodFridayDate = $this->_addDays($easterDate, -2);
     $this->_addHoliday('goodFriday', $goodFridayDate, 'Good Friday');
     $this->_addTranslationForHoliday('goodFriday', 'da_DK', 'Langfredag');
     /**
      * Green Thursday
      */
     $this->_addHoliday('greenThursday', $goodFridayDate->getPrevDay(), 'Green Thursday');
     $this->_addTranslationForHoliday('greenThursday', 'da_DK', 'Skærtorsdag');
     /**
      * Whitsun (determines Whit Monday, Ascension Day and
      * Feast of Corpus Christi)
      */
     $whitsunDate = $this->_addDays($easterDate, 49);
     $this->_addHoliday('whitsun', $whitsunDate, 'Whitsun');
     $this->_addTranslationForHoliday('whitsun', 'da_DK', 'Pinsedag');
     /**
      * Whit Monday
      */
     $this->_addHoliday('whitMonday', $whitsunDate->getNextDay(), 'Whit Monday');
     $this->_addTranslationForHoliday('whitMonday', 'da_DK', '2. Pinsedag');
     /**
      * Ascension Day
      */
     $ascensionDayDate = $this->_addDays($whitsunDate, -10);
     $this->_addHoliday('ascensionDay', $ascensionDayDate, 'Ascension Day');
     $this->_addTranslationForHoliday('ascensionDay', 'da_DK', 'Kr. Himmelfart');
     /**
      * Heart of Jesus (General Prayer Day)
      *
      * Friday of the 3rd week past Whitsun
      */
     $heartJesusDate = $this->_addDays($goodFridayDate, 28);
     $this->_addHoliday('heartJesus', $heartJesusDate, 'Heart of Jesus celebration');
     $this->_addTranslationForHoliday('heartJesus', 'da_DK', 'Store Bededag');
     /**
      * Christmas Eve
      */
     $this->_addHoliday('christmasEve', $this->_year . '-12-24', 'Christmas Eve');
     $this->_addTranslationForHoliday('christmasEve', 'da_DK', 'Juleaften');
     /**
      * Christmas day
      */
     $this->_addHoliday('christmasDay', $this->_year . '-12-25', 'Christmas Day');
     $this->_addTranslationForHoliday('christmasDay', 'da_DK', '1. Juledag');
     /**
      * Second Christmas Day
      */
     $this->_addHoliday('secondChristmasDay', $this->_year . '-12-26', 'Boxing Day');
     $this->_addTranslationForHoliday('secondChristmasDay', 'da_DK', '2. Juledag');
     /**
      * New Year's Eve
      */
     $this->_addHoliday('newYearsEve', $this->_year . '-12-31', 'New Year\'s Eve');
     $this->_addTranslationForHoliday('newYearsEve', 'da_DK', 'Nytårsaften');
     if (Date_Holidays::errorsOccurred()) {
         return Date_Holidays::getErrorStack();
     }
     return true;
 }
コード例 #12
0
 /**
  * Build the internal arrays that contain data about the calculated holidays
  *
  * @access protected
  * @return boolean true on success, otherwise a PEAR_ErrorStack object
  * @throws object PEAR_ErrorStack
  */
 function _buildHolidays()
 {
     /**
      * New Year's Day
      */
     $this->_addHoliday('newYearsDay', $this->_year . '-01-01', 'New Year\'s Day');
     $this->_addTranslationForHoliday('newYearsDay', 'DU_NL', 'Nieuwjaarsdag');
     /**
      * Epiphanias
      */
     $this->_addHoliday('epiphany', $this->_year . '-01-06', 'Epiphany');
     $this->_addTranslationForHoliday('epiphany', 'DU_NL', 'Drie Koningen');
     /**
      * Valentine's Day
      */
     $this->_addHoliday('valentineDay', $this->_year . '-02-14', 'Valentine\'s Day');
     $this->_addTranslationForHoliday('valentineDay', 'DU_NL', 'Valentijnsdag');
     /**
      * Queen's Day
      */
     $this->_addHoliday('queenDay', $this->_year . '-04-30', 'Queen\'s Day');
     $this->_addTranslationForHoliday('queenDay', 'DU_NL', 'Koninginnedag');
     /**
      * Commemoration Day Day
      */
     $this->_addHoliday('commemorationDay', $this->_year . '-05-04', 'Commemoration Day');
     $this->_addTranslationForHoliday('commemorationDay', 'DU_NL', 'Dodenherdenking');
     /**
      * Liberation Day
      */
     $this->_addHoliday('liberationDay', $this->_year . '-05-05', 'Liberation Day');
     $this->_addTranslationForHoliday('liberationDay', 'DU_NL', 'Bevrijdingsdag');
     /**
      * Easter Sunday
      */
     $easterDate = Date_Holidays_Driver_Christian::calcEaster($this->_year);
     $this->_addHoliday('easter', $easterDate, 'Easter Sunday');
     $this->_addTranslationForHoliday('easter', 'DU_NL', '1e Paasdag');
     /**
      * Easter Monday
      */
     $this->_addHoliday('easterMonday', $easterDate->getNextDay(), 'Easter Monday');
     $this->_addTranslationForHoliday('easterMonday', 'DU_NL', '2e Paasdag');
     /**
      * Good Friday / Black Friday
      */
     $goodFridayDate = $this->_addDays($easterDate, 2);
     $this->_addHoliday('goodFriday', $goodFridayDate, 'Good Friday');
     $this->_addTranslationForHoliday('goodFriday', 'DU_NL', 'Goede Vrijdag');
     /**
      * Whitsun (determines Whit Monday, Ascension Day and Feast of
      * Corpus Christi)
      */
     $whitsunDate = $this->_addDays($easterDate, 49);
     $this->_addHoliday('whitsun', $whitsunDate, 'Whitsun');
     $this->_addTranslationForHoliday('whitsun', 'DU_NL', '1e Pinksterdag');
     /**
      * Whit Monday
      */
     $this->_addHoliday('whitMonday', $whitsunDate->getNextDay(), 'Whit Monday');
     $this->_addTranslationForHoliday('whitMonday', 'DU_NL', '2e Pinksterdag');
     /**
      * Ascension Day
      */
     $ascensionDayDate = $this->_addDays($whitsunDate, -10);
     $this->_addHoliday('ascensionDay', $ascensionDayDate, 'Ascension Day');
     $this->_addTranslationForHoliday('ascensionDay', 'DU_NL', 'Hemelvaartsdag');
     /**
      * Christmas day
      */
     $this->_addHoliday('christmasDay', $this->_year . '-12-25', 'Christmas Day');
     $this->_addTranslationForHoliday('christmasDay', 'DU_NL', '1e Kerstdag');
     /**
      * Second Christmas Day
      */
     $this->_addHoliday('secondChristmasDay', $this->_year . '-12-26', 'Boxing Day');
     $this->_addTranslationForHoliday('secondChristmasDay', 'DU_NL', '2e Kerstdag');
     /**
      * New Year's Eve
      */
     $this->_addHoliday('newYearsEve', $this->_year . '-12-31', "New Year's Eve");
     $this->_addTranslationForHoliday('newYearsEve', 'DU_NL', 'Oudjaarsdag');
     if (Date_Holidays::errorsOccurred()) {
         return Date_Holidays::getErrorStack();
     }
     return true;
 }
コード例 #13
0
 /**
  * Build the internal arrays that contain data about the calculated holidays
  *
  * @access protected
  * @return boolean true on success, otherwise a PEAR_ErrorStack object
  * @throws object PEAR_ErrorStack
  */
 function _buildHolidays()
 {
     /**
      * New Year's Day
      */
     $newYearsDayDate = $this->_calcNearestWorkDay('01', '01');
     $this->_addHoliday('newYearsDay', $newYearsDayDate, 'New Year\'s Day');
     /**
      * Human Rights Day
      */
     $humanRightsDayDate = $this->_calcNearestWorkDay('03', '21');
     $this->_addHoliday('humanRightsDay', $humanRightsDayDate, 'Human Rights Day');
     /**
      * Easter Sunday
      */
     $easterDate = Date_Holidays_Driver_Christian::calcEaster($this->_year);
     /**
      * Good Friday
      */
     $goodFridayDate = new Date($easterDate);
     $goodFridayDate = $this->_addDays($easterDate, -2);
     $this->_addHoliday('goodFriday', $goodFridayDate, 'Good Friday');
     /**
      * Family Day
      */
     $this->_addHoliday('easterMonday', $easterDate->getNextDay(), 'Family Day');
     /**
      * Freedom Day
      */
     $freedomDayDate = $this->_calcNearestWorkDay('04', '27');
     $this->_addHoliday('freedomDay', $freedomDayDate, 'Freedom Day');
     /**
      * Worker's Day
      */
     $workersDayDate = $this->_calcNearestWorkDay('05', '01');
     $this->_addHoliday('workersDay', $workersDayDate, 'Worker\'s Day');
     /**
      * Youth Day
      */
     $youthDayDate = $this->_calcNearestWorkDay('06', '16');
     $this->_addHoliday('youthDay', $youthDayDate, 'Youth Day');
     /**
      * National Women's Day
      */
     $womensDayDate = $this->_calcNearestWorkDay('08', '09');
     $this->_addHoliday('womensDay', $womensDayDate, 'Women\'s Day');
     /**
      * Heritage Day
      */
     $heritageDayDate = $this->_calcNearestWorkDay('09', '24');
     $this->_addHoliday('heritageDay', $heritageDayDate, 'Heritage Day');
     /**
      * Day of Reconciliation
      */
     $dayOfReconciliation = $this->_calcNearestWorkDay('12', '16');
     $this->_addHoliday('dayOfReconciliation', $dayOfReconciliation, 'Day of Reconciliation');
     /**
      * Christmas Day
      */
     $christmasDay = $this->_calcNearestWorkDay('12', '25');
     $this->_addHoliday('christmasDay', $christmasDay, 'Christmas Day');
     /**
      * Day of Goodwill
      */
     $dayOfGoodwill = $this->_calcNearestWorkDay('12', '26');
     $this->_addHoliday('dayOfGoodwill', $dayOfGoodwill, 'Day of Goodwill');
     if (Date_Holidays::errorsOccurred()) {
         return Date_Holidays::getErrorStack();
     }
     return true;
 }
コード例 #14
0
ファイル: Christian.php プロジェクト: slawekmikula/dotproject
 /**
  * Build the internal arrays that contain data about the calculated holidays
  *
  * @access   protected
  * @return   boolean true on success, otherwise a PEAR_ErrorStack object
  * @throws   object PEAR_ErrorStack
  */
 function _buildHolidays()
 {
     /**
      * Circumcision of Jesus
      */
     $this->_addHoliday('jesusCircumcision', $this->_year . '-01-01', 'Circumcision of Jesus');
     /**
      * Epiphanias
      */
     $this->_addHoliday('epiphany', $this->_year . '-01-06', 'Epiphany');
     /**
      * Cleaning of Mariä 
      */
     $this->_addHoliday('mariaCleaning', $this->_year . '-02-02', 'Cleaning of Maria');
     /**
      * Josef's Day
      */
     $this->_addHoliday('josefsDay', $this->_year . '-03-19', 'Josef\'s Day');
     /**
      * Maria Announcement
      */
     $this->_addHoliday('mariaAnnouncement', $this->_year . '-03-25', 'Maria Announcement');
     /**
      * Easter Sunday
      */
     $easterDate = Date_Holidays_Driver_Christian::calcEaster($this->_year);
     $this->_addHoliday('easter', $easterDate, 'Easter Sunday');
     /**
      * Palm Sunday
      */
     $palmSundayDate = new Date($easterDate);
     $palmSundayDate->subtractSpan(new Date_Span('7, 0, 0, 0'));
     $this->_addHoliday('palmSunday', $palmSundayDate, 'Palm Sunday');
     /**
      * Passion Sunday
      */
     $passionSundayDate = new Date($palmSundayDate);
     $passionSundayDate->subtractSpan(new Date_Span('7, 0, 0, 0'));
     $this->_addHoliday('passionSunday', $passionSundayDate, 'Passion Sunday');
     /**
      * Painful Friday
      */
     $painfulFridayDate = new Date($palmSundayDate);
     $painfulFridayDate->subtractSpan(new Date_Span('2, 0, 0, 0'));
     $this->_addHoliday('painfulFriday', $painfulFridayDate, 'Painful Friday');
     /**
      * White Sunday
      */
     $whiteSundayDate = new Date($easterDate);
     $whiteSundayDate->addSpan(new Date_Span('7, 0, 0, 0'));
     $this->_addHoliday('whiteSunday', $whiteSundayDate, 'White Sunday');
     /**
      * Ash Wednesday
      */
     $ashWednesdayDate = new Date($easterDate);
     $ashWednesdayDate->subtractSpan(new Date_Span('46, 0, 0, 0'));
     $this->_addHoliday('ashWednesday', $ashWednesdayDate, 'Ash Wednesday');
     /**
      * Good Friday / Black Friday
      */
     $goodFridayDate = new Date($easterDate);
     $goodFridayDate->subtractSpan(new Date_Span('2, 0, 0, 0'));
     $this->_addHoliday('goodFriday', $goodFridayDate, 'Good Friday');
     /**
      * Green Thursday
      */
     $this->_addHoliday('greenThursday', $goodFridayDate->getPrevDay(), 'Green Thursday');
     /**
      * Easter Monday
      */
     $this->_addHoliday('easterMonday', $easterDate->getNextDay(), 'Easter Monday');
     /**
      * Whitsun (determines Whit Monday, Ascension Day and Feast of Corpus Christi)
      */
     $whitsunDate = new Date($easterDate);
     $whitsunDate->addSpan(new Date_Span('49, 0, 0, 0'));
     $this->_addHoliday('whitsun', $whitsunDate, 'Whitsun');
     /**
      * Request Sunday
      */
     $requestSunday = new Date($whitsunDate);
     $requestSunday->subtractSpan(new Date_Span('14, 0, 0, 0'));
     $this->_addHoliday('requestSunday', $requestSunday, 'Request Sunday');
     /**
      * Ascension Day
      */
     $ascensionDayDate = new Date($whitsunDate);
     $ascensionDayDate->subtractSpan(new Date_Span('10, 0, 0, 0'));
     $this->_addHoliday('ascensionDay', $ascensionDayDate, 'Ascension Day');
     /**
      * Whit Monday
      */
     $this->_addHoliday('whitMonday', $whitsunDate->getNextDay(), 'Whit Monday');
     /**
      * Haunting of Mariä 
      */
     $this->_addHoliday('mariaHaunting', $this->_year . '-05-31', 'Haunting of Maria');
     /**
      * Trinitatis
      */
     $trinitatisDate = new Date($whitsunDate);
     $trinitatisDate->addSpan(new Date_Span('7, 0, 0, 0'));
     $this->_addHoliday('trinitatis', $trinitatisDate, 'Trinitatis');
     /**
      * Feast of Corpus Christi
      */
     $corpusChristiDate = new Date($whitsunDate);
     $corpusChristiDate->addSpan(new Date_Span('11, 0, 0, 0'));
     $this->_addHoliday('corpusChristi', $corpusChristiDate, 'Feast of Corpus Christi');
     /**
      * Heart of Jesus 
      *
      * Friday of the 3rd week past Whitsun
      */
     $heartJesusDate = new Date($whitsunDate);
     $heartJesusDate->addSpan(new Date_Span('19, 0, 0, 0'));
     $this->_addHoliday('heartJesus', $heartJesusDate, 'Heart of Jesus celebration');
     /**
      * Johannis celebration
      */
     $this->_addHoliday('johannisCelebration', $this->_year . '-06-24', 'Johannis celebration');
     /**
      * Petrus and Paulus
      */
     $this->_addHoliday('petrusAndPaulus', $this->_year . '-06-29', 'Petrus and Paulus');
     /**
      * Ascension of Maria
      */
     $this->_addHoliday('mariaAscension', $this->_year . '-08-15', 'Ascension of Maria');
     /**
      * Celebration of raising the Cross
      */
     $this->_addHoliday('crossRaising', $this->_year . '-09-14', 'Celebration of raising the Cross');
     /**
      * Thanks Giving
      * 
      * Sunday past Michaelis (29. September)
      */
     $michaelisDate = new Date($this->_year . '-09-29');
     $dayOfWeek = $michaelisDate->getDayOfWeek();
     $michaelisDate->addSpan(new Date_Span(sprintf('%d, 0, 0, 0', 7 - $dayOfWeek)));
     $thanksGivingDate = $michaelisDate;
     $this->_addHoliday('thanksGiving', $thanksGivingDate, 'Thanks Giving');
     /**
      * Kermis
      *
      * 3rd Sunday in October
      */
     $kermisDate = new Date($this->_year . '-10-01');
     $dayOfWeek = $kermisDate->getDayOfWeek();
     if ($dayOfWeek != 0) {
         $kermisDate->addSpan(new Date_Span(sprintf('%d, 0, 0, 0', 7 - $dayOfWeek)));
     }
     $kermisDate->addSpan(new Date_Span('14, 0, 0, 0'));
     $this->_addHoliday('kermis', $kermisDate, 'Kermis');
     /**
      * Reformation Day
      */
     $this->_addHoliday('reformationDay', $this->_year . '-10-31', 'Reformation Day');
     /**
      * All Saints' Day
      */
     $this->_addHoliday('allSaintsDay', $this->_year . '-11-01', 'All Saints\' Day');
     /**
      * All Souls' Day
      */
     $this->_addHoliday('allSoulsDay', $this->_year . '-11-02', 'All Souls\' Day');
     /**
      * Martin's Day
      */
     $this->_addHoliday('martinsDay', $this->_year . '-11-11', 'Martin\'s Day');
     /**
      * 4th Advent
      */
     $Advent4Date = new Date($this->_year . '-12-24');
     $dayOfWeek = $Advent4Date->getDayOfWeek();
     if ($dayOfWeek == 0) {
         $dayOfWeek = 7;
     }
     $Advent4Date->subtractSpan(new Date_Span(sprintf('%d, 0, 0, 0', $dayOfWeek)));
     $this->_addHoliday('advent4', $Advent4Date, '4th Advent');
     /**
      * 1st Advent
      */
     $Advent1Date = new Date($Advent4Date);
     $Advent1Date->subtractSpan(new Date_Span('21, 0, 0, 0'));
     $this->_addHoliday('advent1', $Advent1Date, '1st Advent');
     /**
      * 2nd Advent
      */
     $Advent2Date = new Date($Advent4Date);
     $Advent2Date->subtractSpan(new Date_Span('14, 0, 0, 0'));
     $this->_addHoliday('advent2', $Advent2Date, '2nd Advent');
     /**
      * 3rd Advent
      */
     $Advent3Date = new Date($Advent4Date);
     $Advent3Date->subtractSpan(new Date_Span('7, 0, 0, 0'));
     $this->_addHoliday('advent3', $Advent3Date, '3rd Advent');
     /**
      * Death' Sunday
      */
     $deathSundayDate = new Date($Advent1Date);
     $deathSundayDate->subtractSpan(new Date_Span('7, 0, 0, 0'));
     $this->_addHoliday('deathSunday', $deathSundayDate, 'Death\' Sunday');
     /**
      * Day of Repentance
      */
     $dayOfRepentance = new Date($deathSundayDate);
     $dayOfRepentance->subtractSpan(new Date_Span('4, 0, 0, 0'));
     $this->_addHoliday('dayOfRepentance', $dayOfRepentance, 'Day of Repentance');
     /**
      * St. Nicholas' Day
      */
     $this->_addHoliday('stNicholasDay', $this->_year . '-12-06', 'St. Nicholas\' Day');
     /**
      * Maria' conception
      */
     $this->_addHoliday('mariaConception', $this->_year . '-12-08', 'Conception of Maria');
     /**
      * Christmas Eve
      */
     $this->_addHoliday('xmasEve', $this->_year . '-12-24', 'Christmas Eve');
     /**
      * Christmas day
      */
     $this->_addHoliday('xmasDay', $this->_year . '-12-25', 'Christmas Day');
     /**
      * Boxing day
      */
     $this->_addHoliday('boxingDay', $this->_year . '-12-26', 'Boxing Day');
     /**
      * New Year's Eve
      */
     $this->_addHoliday('newYearsEve', $this->_year . '-12-31', 'New Year\'s Eve');
     if (Date_Holidays::errorsOccurred()) {
         return Date_Holidays::getErrorStack();
     }
     return true;
 }
コード例 #15
0
 /**
  * Build the internal arrays that contain data about the calculated holidays
  *
  * @access   protected
  * @return   boolean true on success, otherwise a PEAR_ErrorStack object
  * @throws   object PEAR_ErrorStack
  */
 function _buildHolidays()
 {
     /**
      * New Year's Day
      */
     $this->_addHoliday('novoleto1', $this->_year . '-01-01', 'Novo leto');
     $this->_addHoliday('novoleto2', $this->_year . '-01-02', 'Novo leto');
     /**
      * Prešernov dan
      */
     $this->_addHoliday('preseren', $this->_year . '-02-08', 'Prešernov dan, slovenski kulturni praznik');
     /**
      * Dan upora proti okupatorju
      */
     $this->_addHoliday('okupator', $this->_year . '-04-27', 'Dan upora proti okupatorju');
     /**
      * Praznik dela
      */
     $this->_addHoliday('delo1', $this->_year . '-05-01', 'Praznik dela');
     $this->_addHoliday('delo2', $this->_year . '-05-02', 'Praznik dela');
     /**
      * Dan državnosti
      */
     $this->_addHoliday('drzavnost', $this->_year . '-06-25', 'Dan državnosti');
     /**
      * Easter Sunday
      */
     $easter = Date_Holidays_Driver_Christian::calcEaster($this->_year);
     $this->_addHoliday('vnoc', $easter, 'Velika noč');
     /**
      * Easter Monday
      */
     $easterMon = clone $easter;
     $easterMon->day++;
     $this->_addHoliday('vnocpon', $easterMon, 'Velikonočni ponedeljek');
     /**
      * Binkosti
      */
     $easterMon = clone $easter;
     $easterMon->day += 50;
     $this->_addHoliday('binkosti', $easter, 'Binkoštna nedelja - binkošti');
     /**
      * Marijino vnebovzetje
      */
     $this->_addHoliday('marija', $this->_year . '-08-15', 'Marijino vnebovzetje');
     /**
      * Združitev prekmurskih Slovencev
      */
     $this->_addHoliday('prekmurski', $this->_year . '-08-17', 'Združitev prekmurskih Slovencev z matičnim narodom');
     /**
      * Združitev prekmurskih Slovencev
      */
     $this->_addHoliday('primorska', $this->_year . '-09-15', 'Vrnitev Primorske k matični domovini');
     /**
      * Dan reformacije
      */
     $this->_addHoliday('reformacija', $this->_year . '-10-31', 'Dan reformacije');
     /**
      * Dan spomina na mrtve
      */
     $this->_addHoliday('danmrtvih', $this->_year . '-11-01', 'Dan spomina na mrtve');
     /**
      * Dan spomina na mrtve
      */
     $this->_addHoliday('maister', $this->_year . '-11-23', 'Dan Rudolfa Maistra');
     /**
      * Christmas day
      */
     $this->_addHoliday('christmasDay', $this->_year . '-12-25', 'Božič');
     /**
      * Dan samostojnosti in enotnosti
      */
     $this->_addHoliday('samostijnosti', $this->_year . '-12-26', 'Dan samostojnosti in enotnosti');
     if (Date_Holidays::errorsOccurred()) {
         return Date_Holidays::getErrorStack();
     }
     return true;
 }
コード例 #16
0
 /**
  * Build the internal arrays that contain data about holidays.
  *
  * @access   protected
  * @return   boolean true on success, otherwise a PEAR_ErrorStack object
  * @throws   object PEAR_ErrorStack
  */
 function _buildHolidays()
 {
     parent::_buildHolidays();
     /**
      * Method that returns the date of the nearest Monday to the specified date
      * 
      * @return Monday date closest to specified date
      * 
      */
     /**
      * New Year's Day and Day after New Year's Day
      * always observed on a working day (1..5)
      * always show New Year's Day regardless of day of week
      */
     $newYearsDay = new Date($this->_year . '-01-01');
     $dayAfterNewYearsDay = new Date($this->_year . '-01-02');
     $this->_addHoliday('newYearsDay', $newYearsDay, 'New Year\'s Day');
     if ($newYearsDay->getDayOfWeek() == 0) {
         $this->_addHoliday('dayAfterNewYearsDay', $this->_year . '-01-02', 'Day after New Year\'s Day');
         $this->_addHoliday('newYearsDayHoliday', $this->_year . '-01-03', 'New Year\'s Holiday');
     } elseif ($newYearsDay->getDayOfWeek() == 5) {
         $this->_addHoliday('dayAfterNewYearsDay', $this->_year . '-01-04', 'New Year\'s Holiday');
     } elseif ($newYearsDay->getDayOfWeek() == 6) {
         $this->_addHoliday('newYearsDayHoliday', $this->_year . '-01-03', 'New Year\'s Holiday');
         $this->_addHoliday('dayAfterNewYearsDay', $this->_year . '-01-04', 'New Year\'s Holiday');
     } else {
         $this->_addHoliday('dayAfterNewYearsDay', $dayAfterNewYearsDay, 'Day after New Year\'s Day');
     }
     /**
      * Waitangi Day
      * always observed on 6 February
      */
     $waitangiDay = new Date($this->_year . '-02-06');
     $this->_addHoliday('waitangiDay', $waitangiDay, 'Waitangi Day');
     /**
      * Easter
      */
     $easter = Date_Holidays_Driver_Christian::calcEaster($this->_year);
     $goodFridayDate = new Date($easter);
     $goodFridayDate = $this->_addDays($easter, -2);
     $this->_addHoliday('goodFriday', $goodFridayDate, 'Good Friday');
     $this->_addHoliday('easterMonday', $easter->getNextDay(), 'Easter Monday');
     /**
      * Anzac Day
      * always observed on 25 April
      * differs from Australia in that there is no working day lost if Anzac Day falls on a weekend
      */
     $anzacDay = new Date($this->_year . '-04-25');
     $this->_addHoliday('anzacDay', $anzacDay, 'Anzac Day');
     /**
      * The Queen's Birthday.
      * always observed on 1st Monday in June
      */
     $queensBirthday = Date_Calc::NWeekdayOfMonth(1, 1, 6, $this->_year);
     $this->_addHoliday('queensBirthday', $queensBirthday, "Queen\\'s Birthday");
     /**
      * Labour Day.
      * observed as 4th Monday in October
      */
     $labourDay = Date_Calc::NWeekdayOfMonth(4, 1, 10, $this->_year);
     $this->_addHoliday('labourDay', $labourDay, "Labour Day");
     /**
      * Christmas and Boxing days
      * always observed on a working day (1..5)
      * always show Christmas and Boxing days
      */
     $christmasDay = new Date($this->_year . '-12-25');
     $boxingDay = new Date($this->_year . '-12-26');
     $this->_addHoliday('christmasDay', $christmasDay, 'Christmas Day');
     $this->_addHoliday('boxingDay', $boxingDay, 'Boxing Day');
     if ($christmasDay->getDayOfWeek() == 0) {
         $this->_addHoliday('christmasDayHoliday', $this->_year . '-12-27', 'Christmas Day Holiday');
     } elseif ($christmasDay->getDayOfWeek() == 5) {
         $this->_addHoliday('boxingDayHoliday', $this->_year . '-12-28', 'Boxing Day Holiday');
     } elseif ($christmasDay->getDayOfWeek() == 6) {
         $this->_addHoliday('christmasDayHoliday', $this->_year . '-12-27', 'Christmas Day Holiday');
         $this->_addHoliday('boxingDayHoliday', $this->_year . '-12-28', 'Boxing Day Holiday');
     }
     /**
      * Regional anniversary calculations
      * http://www.dol.govt.nz/er/holidaysandleave/publicholidays/publicholidaydates/current.asp
      * ordered by date of observation
      * Note - where rule may be modified by proximity of Easter, this is NOT taken into account
      * 
      * Each of 8 regions can use common rule of nearest Monday
      * Southland 17 Jan
      * Wellington 22 Jan
      * Auckland 29 Jan
      * Nelson 1 Feb
      * Otago 23 Mar (some local variation)
      * Marlborough 1 Nov
      * Chatam Islands 30 Nov
      * Westland 1 Dec (some local variation)
      */
     $anniversaryDaySd = new Date($this->_year . '-01-17');
     $this->_addHoliday('anniversaryDaySd', Date_Holidays_Driver_NewZealand::nearestMonday($anniversaryDaySd), "Southland Anniversary Day");
     $anniversaryDayWn = new Date($this->_year . '-01-22');
     $this->_addHoliday('anniversaryDayWn', Date_Holidays_Driver_NewZealand::nearestMonday($anniversaryDayWn), "Wellington Anniversary Day");
     $anniversaryDayAk = new Date($this->_year . '-01-29');
     $this->_addHoliday('anniversaryDayAk', Date_Holidays_Driver_NewZealand::nearestMonday($anniversaryDayAk), "Auckland Anniversary Day");
     $anniversaryDayNn = new Date($this->_year . '-02-01');
     $this->_addHoliday('anniversaryDayNn', Date_Holidays_Driver_NewZealand::nearestMonday($anniversaryDayNn), "Nelson Anniversary Day");
     $anniversaryDayOo = new Date($this->_year . '-03-23');
     $this->_addHoliday('anniversaryDayOo', Date_Holidays_Driver_NewZealand::nearestMonday($anniversaryDayOo), "Otago Anniversary Day");
     $anniversaryDayMb = new Date($this->_year . '-11-01');
     $this->_addHoliday('anniversaryDayMb', Date_Holidays_Driver_NewZealand::nearestMonday($anniversaryDayMb), "Marlborough Anniversary Day");
     $anniversaryDayCi = new Date($this->_year . '-11-30');
     $this->_addHoliday('anniversaryDayCi', Date_Holidays_Driver_NewZealand::nearestMonday($anniversaryDayCi), "Chatam Islands Anniversary Day");
     $anniversaryDayWd = new Date($this->_year . '-12-01');
     $this->_addHoliday('anniversaryDayWd', Date_Holidays_Driver_NewZealand::nearestMonday($anniversaryDayWd), "Westland Anniversary Day");
     /**
      * Taranaki Anniversary.
      * 2nd Monday in March.
      */
     $anniversaryDayTk = Date_Calc::nWeekdayOfMonth(2, 1, 3, $this->_year);
     $this->_addHoliday('anniversaryDayTk', $anniversaryDayTk, "Taranaki Anniversary Day");
     /**
      * South Canterbury Anniversary.
      * 4th Monday in September.
      */
     $anniversaryDaySc = Date_Calc::nWeekdayOfMonth(4, 1, 9, $this->_year);
     $this->_addHoliday('anniversaryDaySc', $anniversaryDaySc, "South Canterbury Anniversary Day");
     /**
      * Hawkes' Bay Anniversary.
      * Friday before Labour Day (or 3rd Friday in October).
      *
      */
     $anniversaryDayHb = Date_Calc::nWeekdayOfMonth(3, 5, 10, $this->_year);
     $this->_addHoliday('anniversaryDayHb', $anniversaryDayHb, "Hawkes\\' Bay Anniversary");
     /**
      * Canterbury Anniversary or Show Day for North and Central Canterbury.
      * 2nd Friday after 1st Tuesday in month of November.
      * find 1st Tuesday then add 10 days
      */
     $anniversaryDayNc = $this->_calcNthWeekDayInMonth(1, 2, 11);
     $anniversaryDayNc = $this->_addDays($anniversaryDayNc, 10);
     $this->_addHoliday('anniversaryDayNc', $anniversaryDayNc, "Canterbury Anniversary Day");
     /**
      * Check for errors, and return.
      */
     if (Date_Holidays::errorsOccurred()) {
         return Date_Holidays::getErrorStack();
     }
     return true;
 }
コード例 #17
0
 /**
  * Build the internal arrays that contain data about the calculated holidays
  *
  * @access   protected
  * @return   boolean true on success, otherwise a PEAR_ErrorStack object
  * @throws   object PEAR_ErrorStack
  */
 function _buildHolidays()
 {
     /**
      * New Year's Day
      */
     $this->_addHoliday('newYearsDay', $this->_year . '-01-01', 'Año nuevo');
     /**
      * Epiphanias
      */
     $this->_addHoliday('epiphany', $this->_year . '-01-06', 'Día de Reyes');
     /**
      * Valentine Day
      */
     $this->_addHoliday('valentinesDay', $this->_year . '-02-14', 'San Valentín');
     /**
      * Easter Sunday
      */
     $easterDate = Date_Holidays_Driver_Christian::calcEaster($this->_year);
     $this->_addHoliday('easter', $easterDate, 'Semana Santa');
     /**
      * Carnival
      */
     $carnival = $this->_addDays($easterDate, -47);
     $this->_addHoliday('carnival', $carnival, 'Carnaval');
     /**
      * Ash Wednesday
      */
     $ashWednesday = $this->_addDays($easterDate, -46);
     $this->_addHoliday('ashWednesday', $ashWednesday, 'Miercoles de Ceniza');
     /**
      * Palm Sunday
      */
     $palmSunday = $this->_addDays($easterDate, -7);
     $this->_addHoliday('palmSunday', $palmSunday, 'Domingo de ramos');
     /**
      * Maundy Thursday
      */
     $maundyThursday = $this->_addDays($easterDate, -3);
     $this->_addHoliday('maundyThursday', $maundyThursday, 'Jueves Santo');
     /**
      * Good Friday
      */
     $goodFriday = $this->_addDays($easterDate, -2);
     $this->_addHoliday('goodFriday', $goodFriday, 'Viernes Santo');
     /**
      * Saint Saturday
      */
     $goodFriday = $this->_addDays($easterDate, -1);
     $this->_addHoliday('saintSaturday', $goodFriday, 'Sabado Santo');
     /**
      * Easter
      */
     $this->_addHoliday('easter', $easterDate, 'Domingo de resurrección');
     /**
      * Fathers Day
      */
     $this->_addHoliday('fathersDay', $this->_year . '-03-19', 'Día del padre');
     /**
      * Day of Work
      */
     $this->_addHoliday('dayOfWork', $this->_year . '-05-01', 'Día del trabajador');
     /**
      * Mothers Day
      */
     $mothersDay = $this->_calcFirstMonday("05");
     $mothersDay = $mothersDay->getPrevDay();
     if ($mothersDay->getDay() == 30) {
         $mothersDay = $this->_addDays($mothersDay, 7);
     }
     $this->_addHoliday('mothersDay', $mothersDay, 'Día de la madre');
     /**
      * Corpus Christi
      */
     $corpusChristi = $this->_addDays($easterDate, 60);
     $this->_addHoliday('corpusChristi', $corpusChristi, 'Corpo de Deus');
     /**
      * Apostle Santiago
      */
     $this->_addHoliday('apostleSantiago', $this->_year . '-07-25', 'Santiago apóstol');
     /**
      * Ascension of Maria
      */
     $this->_addHoliday('mariaAscension', $this->_year . '-08-15', 'Asunción de la Virgen María');
     /**
      * Hispanity Day
      */
     $this->_addHoliday('hispanityDay', $this->_year . '-10-12', 'Día de la hispanidad');
     /**
      * All Saints' Day
      */
     $this->_addHoliday('allSaintsDay', $this->_year . '-11-01', 'Todos los santos');
     /**
      * Constitution's Day
      */
     $this->_addHoliday('constitutionDay', $this->_year . '-12-06', 'Día de la Constitución');
     /**
      * Immaculate Conception
      */
     $this->_addHoliday('immaculateConceptionDay', $this->_year . '-12-08', 'Inmaculada concepción');
     /**
      * Christmas Eve
      */
     $this->_addHoliday('christmasEve', $this->_year . '-12-24', 'Noche buena');
     /**
      * Christmas day
      */
     $this->_addHoliday('christmasDay', $this->_year . '-12-25', 'Navidad');
     /**
      * New Year´s Eve
      */
     $this->_addHoliday('newYearsEve', $this->_year . '-12-31', 'Noche vieja');
     if (Date_Holidays::errorsOccurred()) {
         return Date_Holidays::getErrorStack();
     }
     return true;
 }
コード例 #18
0
 /**
  * Build the internal arrays that contain data about holidays.
  *
  * @access   protected
  * @return   boolean true on success, otherwise a PEAR_ErrorStack object
  * @throws   object PEAR_ErrorStack
  */
 function _buildHolidays()
 {
     parent::_buildHolidays();
     /*
      * New Year's Day
      */
     $newYearsDay = new Date($this->_year . '-01-01');
     if ($newYearsDay->getDayOfWeek() == 0) {
         // 0 = Sunday
         $newYearsDay = $this->_year . '-01-02';
     } elseif ($newYearsDay->getDayOfWeek() == 6) {
         // 6 = Saturday
         $newYearsDay = $this->_year . '-01-03';
     }
     $this->_addHoliday('newYearsDay', $newYearsDay, 'New Year\'s Day');
     /*
      * Australia Day
      */
     $australiaDay = new Date($this->_year . '-01-26');
     if ($australiaDay->getDayOfWeek() == 0) {
         // 0 = Sunday
         $australiaDay = $this->_year . '-01-27';
     } elseif ($australiaDay->getDayOfWeek() == 6) {
         // 6 = Saturday
         $australiaDay = $this->_year . '-01-28';
     }
     $this->_addHoliday('australiaDay', $australiaDay, 'Australia Day');
     /*
      * Easter
      */
     $easter = Date_Holidays_Driver_Christian::calcEaster($this->_year);
     $goodFridayDate = new Date($easter);
     $goodFridayDate = $this->_addDays($easter, -2);
     $this->_addHoliday('goodFriday', $goodFridayDate, 'Good Friday');
     $this->_addHoliday('easterMonday', $easter->getNextDay(), 'Easter Monday');
     /*
      * Anzac Day
      */
     $anzacDay = new Date($this->_year . '-04-25');
     $this->_addHoliday('anzacDay', $anzacDay, 'Anzac Day');
     if ($anzacDay->getDayOfWeek() == 0) {
         // 0 = Sunday
         $anzacDayHol = $this->_year . '-04-26';
         $this->_addHoliday('anzacDayHoliday', $anzacDayHol, 'Anzac Day Holiday');
     } elseif ($anzacDay->getDayOfWeek() == 6) {
         // 6 = Saturday
         $anzacDayHol = $this->_year . '-04-27';
         $this->_addHoliday('anzacDayHoliday', $anzacDayHol, 'Anzac Day Holiday');
     }
     /*
      * The Queen's Birthday.
      * See http://en.wikipedia.org/wiki/Queen%27s_Official_Birthday#Australia
      */
     $queensBirthday = Date_Calc::nWeekdayOfMonth(1, 1, 6, $this->_year);
     $this->_addHoliday('queensBirthday', $queensBirthday, "Queen's Birthday");
     /*
      * Christmas and Boxing days
      */
     $christmasDay = new Date($this->_year . '-12-25');
     $boxingDay = new Date($this->_year . '-12-26');
     $this->_addHoliday('christmasDay', $christmasDay, 'Christmas Day');
     $this->_addHoliday('boxingDay', $boxingDay, 'Boxing Day');
     if ($christmasDay->getDayName() == 'Sunday') {
         $this->_addHoliday('boxingDayHoliday', $this->_year . '-12-27', 'Boxing Day Holiday');
     } elseif ($christmasDay->getDayName() == 'Friday') {
         $this->_addHoliday('boxingDayHoliday', $this->_year . '-12-28', 'Boxing Day Holiday');
     } elseif ($christmasDay->getDayName() == 'Saturday') {
         $this->_addHoliday('christmasDayHoliday', $this->_year . '-12-27', 'Christmas Day Holiday');
         $this->_addHoliday('boxingDayHoliday', $this->_year . '-12-28', 'Boxing Day Holiday');
     }
     /*
      * Check for errors, and return.
      */
     if (Date_Holidays::errorsOccurred()) {
         return Date_Holidays::getErrorStack();
     }
     return true;
 }