Source for file Christian.php
Documentation is available at Christian.php
/* vim: set expandtab tabstop=4 shiftwidth=4: */
* Driver for Christian holidays
* 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 Carsten Lucke <luckec@tool-garage.de>
* @license http://www.php.net/license/3_01.txt PHP License 3.0.1
* @link http://pear.php.net/package/Date_Holidays
* class that calculates Christian holidays
* @author Carsten Lucke <luckec@tool-garage.de>
* @license http://www.php.net/license/3_01.txt PHP License 3.0.1
* @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
'Circumcision of Jesus');
$this->_addHoliday('easter', $easterDate, 'Easter Sunday');
$palmSundayDate = $this->_addDays($easterDate, -7 );
$this->_addHoliday('palmSunday', $palmSundayDate, 'Palm Sunday');
$passionSundayDate = $this->_addDays($palmSundayDate, -7 );
$this->_addHoliday('passionSunday', $passionSundayDate, 'Passion Sunday');
$painfulFridayDate = $this->_addDays($palmSundayDate, -2 );
$this->_addHoliday('painfulFriday', $painfulFridayDate, 'Painful Friday');
$whiteSundayDate = $this->_addDays($easterDate, 7 );
$this->_addHoliday('whiteSunday', $whiteSundayDate, 'White Sunday');
$ashWednesdayDate = $this->_addDays($easterDate, -46 );
$this->_addHoliday('ashWednesday', $ashWednesdayDate, 'Ash Wednesday');
* Good Friday / Black Friday
$goodFridayDate = $this->_addDays($easterDate, -2 );
$this->_addHoliday('goodFriday', $goodFridayDate, 'Good Friday');
$goodFridayDate->getPrevDay (),
$easterDate->getNextDay (),
* Whitsun (determines Whit Monday, Ascension Day and
* Feast of Corpus Christi)
$whitsunDate = $this->_addDays($easterDate, 49 );
$this->_addHoliday('whitsun', $whitsunDate, 'Whitsun');
$requestSunday = $this->_addDays($whitsunDate, -14 );
$this->_addHoliday('requestSunday', $requestSunday, 'Request Sunday');
$ascensionDayDate = $this->_addDays($whitsunDate, -10 );
$this->_addHoliday('ascensionDay', $ascensionDayDate, 'Ascension Day');
$this->_addHoliday('whitMonday', $whitsunDate->getNextDay (), 'Whit Monday');
$trinitatisDate = $this->_addDays($whitsunDate, 7 );
* Feast of Corpus Christi
$corpusChristiDate = $this->_addDays($whitsunDate, 11 );
'Feast of Corpus Christi');
* Friday of the 3rd week past Whitsun
$heartJesusDate = $this->_addDays($whitsunDate, 19 );
'Heart of Jesus celebration');
* Celebration of raising the Cross
'Celebration of raising the Cross');
* Sunday past Michaelis (29. September)
$michaelisDate = new Date ($this->_year . '-09-29');
$dayOfWeek = $michaelisDate->getDayOfWeek ();
$michaelisDate = $this->_addDays($michaelisDate, 7 - $dayOfWeek);
$thanksGivingDate = $michaelisDate;
$this->_addHoliday('thanksGiving', $thanksGivingDate, 'Thanks Giving');
$kermisDate = new Date ($this->_year . '-10-01');
$dayOfWeek = $kermisDate->getDayOfWeek ();
$kermisDate = $this->_addDays($kermisDate, 7 - $dayOfWeek);
$kermisDate = $this->_addDays($kermisDate, 14 );
$Advent4Date = new Date ($this->_year . '-12-25');
$dayOfWeek = $Advent4Date->getDayOfWeek ();
$Advent4Date = $this->_addDays($Advent4Date, - $dayOfWeek);
$this->_addHoliday('advent4', $Advent4Date, '4th Advent');
$Advent1Date = $this->_addDays($Advent4Date, -21 );
$this->_addHoliday('advent1', $Advent1Date, '1st Advent');
$Advent2Date = $this->_addDays($Advent4Date, -14 );
$this->_addHoliday('advent2', $Advent2Date, '2nd Advent');
$Advent3Date = $this->_addDays($Advent4Date, -7 );
$this->_addHoliday('advent3', $Advent3Date, '3rd Advent');
$deathSundayDate = $this->_addDays($Advent1Date, -7 );
$this->_addHoliday('deathSunday', $deathSundayDate, 'Death\' Sunday');
$dayOfRepentance = $this->_addDays($deathSundayDate, -4 );
$this->_addHoliday('dayOfRepentance', $dayOfRepentance, 'Day of Repentance');
* Calculates date for Easter using the Gaussian algorithm.
strtotime(" $year-03-21 + " . easter_days ($year) . " days"),
// number of days from 21 March to the Paschal Full Moon
// weekday of the Full Moon (0=Sunday,...)
$century = floor($year / 100 );
$l = floor($century / 4 );
$epact = ($century - $l - floor((8 * $century + 13 ) / 25 )
+ 19 * $golden + 15 ) % 30;
$i = $epact - floor($epact / 28 ) * (1 - floor($epact / 28 ) *
floor(29 / ($epact + 1 )) * floor((21 - $golden) / 11 ));
$j = ($year + floor($year / 4 ) + $i + 2 - $century + $l);
$i = (19 * $golden + 15 ) % 30;
$j = ($year + floor($year / 4 ) + $i) % 7;
$month = 3 + floor(($l + 40 ) / 44 );
$day = $l + 28 - 31 * floor($month / 4 );
$date = new Date (sprintf('%04d-%02d-%02d', $year, $month, $day));
Documentation generated on Tue, 22 Jan 2013 01:00:06 +0000 by phpDocumentor 1.4.3. PEAR Logo Copyright © PHP Group 2004.
|