Source for file Germany.php
Documentation is available at Germany.php
/* vim: set expandtab tabstop=4 shiftwidth=4: */
* Driver for holidays in Germany
* Copyright (c) 1997-2008 The PHP Group
* This source file is subject to version 3.0 of the PHP license,
* that is bundled with this package in the file LICENSE, and is
* available at through the world-wide-web at
* http://www.php.net/license/3_01.txt.
* If you did not receive a copy of the PHP license and are unable to
* obtain it through the world-wide-web, please send a note to
* license@php.net so we can mail you a copy immediately.
* @author Stephan Schmidt <schst@php-tools.net>
* @author Carsten Lucke <luckec@tool-garage.de>
* @license http://www.php.net/license/3_01.txt PHP License 3.0.1
* @version CVS: $Id: Germany.php,v 1.11 2008/01/26 00:08:34 kguest Exp $
* @link http://pear.php.net/package/Date_Holidays
* Extends Christian driver
require_once 'Date/Holidays/Driver/Christian.php';
* class that calculates German holidays
* @author Carsten Lucke <luckec@tool-garage.de>
* @author Stephan Schmidt <schst@php.net>
* @license http://www.php.net/license/3_01.txt PHP License 3.0.1
* @version CVS: $Id: Germany.php,v 1.11 2008/01/26 00:08:34 kguest Exp $
* @link http://pear.php.net/package/Date_Holidays
* Use the Date_Holidays::factory() method to construct an object of a
* Build the internal arrays that contain data about the calculated holidays
* @return boolean true on success, otherwise a PEAR_ErrorStack object
* @throws object PEAR_ErrorStack
$wFasnetDate = new Date ($ashWednesdayDate);
$wFasnetDate->subtractSpan (new Date_Span ('6, 0, 0, 0'));
$this->_addHoliday('womenFasnet', $wFasnetDate, 'Carnival');
$fasnetDate = new Date ($easterDate);
$fasnetDate->subtractSpan (new Date_Span ('47, 0, 0, 0'));
$roseMondayDate = new Date ($easterDate);
$roseMondayDate->subtractSpan (new Date_Span ('48, 0, 0, 0'));
$this->_addHoliday('roseMonday', $roseMondayDate, 'Rose Monday');
* International Women's Day
'International Women\'s Day');
* Girls' Day (fourth Thursday in April)
$girlsDayDate = new Date ($this->_year . '-04-01');
$dayOfWeek = $girlsDayDate->getDayOfWeek ();
$span = new Date_Span (sprintf('%d, 0, 0, 0', 4 - $dayOfWeek + 21 ));
$span = new Date_Span ('21, 0, 0, 0');
$span = new Date_Span (sprintf('%d, 0, 0, 0', -1 * $dayOfWeek + 11 + 21 ));
$girlsDayDate->addSpan ($span);
$this->_addHoliday('girlsDay', $girlsDayDate, 'Girls\' Day');
* International Earth' Day
'International Earth\' Day');
$laughingDayDate = new Date ($this->_year . '-05-01');
while ($laughingDayDate->getDayOfWeek () != 0 ) {
$laughingDayDate = $laughingDayDate->getNextDay ();
'World\'s Laughing Day');
$mothersDay = new Date ($laughingDayDate);
$mothersDay->addSpan (new Date_Span ('7, 0, 0, 0'));
$this->_addHoliday('mothersDay', $mothersDay, 'Mothers\' Day');
* End of World War 2 in Germany
'End of World War 2 in Germany');
$this->_addHoliday('fathersDay', $ascensionDayDate, 'Fathers\' Day');
* Amnesty International Day
'Amnesty International Day');
* International Children' Day
'International Children\'s Day');
$organDonationDate = new Date ($this->_year . '-06-01');
while ($organDonationDate->getDayOfWeek () != 6 ) {
$organDonationDate = $organDonationDate->getNextDay ();
'Day of organ donation');
'Christopher Street Day');
* Hiroshima Commemoration Day
'Hiroshima Commemoration Day');
* Augsburg peace celebration
'Augsburg peace celebration');
* International left-handeds' Day
'International left-handeds\' Day');
$germanLangDayDate = new Date ($this->_year . '-09-01');
while ($germanLangDayDate->getDayOfWeek () != 6 ) {
$germanLangDayDate = $germanLangDayDate->getNextDay ();
$germanLangDayDate->addSpan (new Date_Span ('7, 0, 0, 0'));
'Day of German Language');
* International diabetes day
'International diabetes day');
'German Unification Day');
* year <= 1948: 7th of January
* year > 1948: last Sunday in October
if ($this->_year <= 1948 ) {
$stampsDayDate = new Date ($this->_year . '-01-07');
while ($stampsDayDate->getDayOfWeek () != 0 ) {
$stampsDayDate = $stampsDayDate->getNextDay ();
$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
'International Men\'s Day');
* Fall of the Wall of Berlin
'Fall of the Wall of Berlin 1989');
* Beginning of the Carnival
'Beginning of the Carnival');
* People's Day of Mourning
$dayOfMourning = new Date;
$dayOfMourning->copy ($advent1Date);
$dayOfMourning->subtractSpan (new Date_Span ('14, 0, 0, 0'));
'People\'s Day of Mourning');
* Method that returns an array containing the ISO3166 codes that may possibly
* @return array possible ISO3166 codes
return array ('de', 'deu');
Documentation generated on Thu, 10 Apr 2008 20:00:18 -0400 by phpDocumentor 1.4.0. PEAR Logo Copyright © PHP Group 2004.
|