Source for file EasternChristian.php
Documentation is available at EasternChristian.php
/* vim: set expandtab tabstop=4 shiftwidth=4: */
* Driver for Eastern 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 Ken Guest <ken@linux.ie>
* @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 Eastern Christian holidays
* @author Ken Guest <ken@linux.ie>
* @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('epiphany', $year . '-01-06', 'Epiphany');
$this->_addHoliday('easter', $easterDate, 'Easter Sunday');
$palmSundayDate = $this->_addDays($easterDate, -7 );
$this->_addHoliday('palmSunday', $palmSundayDate, 'Palm Sunday');
$passionSundayDate = new Date ($palmSundayDate);
#$passionSundayDate->subtractSpan(new Date_Span('7, 0, 0, 0'));
$passionSundayDate = $this->_addDays($palmSundayDate, -7 );
$this->_addHoliday('passionSunday', $passionSundayDate, 'Passion Sunday');
#$painfulFridayDate = new Date($palmSundayDate);
#$painfulFridayDate->subtractSpan(new Date_Span('2, 0, 0, 0'));
$painfulFridayDate = $this->_addDays($palmSundayDate, -2 );
$this->_addHoliday('painfulFriday', $painfulFridayDate, 'Painful Friday');
#$whiteSundayDate = new Date($easterDate);
#$whiteSundayDate->addSpan(new Date_Span('7, 0, 0, 0'));
$whiteSundayDate = $this->_addDays($easterDate, 7 );
$this->_addHoliday('whiteSunday', $whiteSundayDate, 'White Sunday');
#$ashWednesdayDate = new Date($easterDate);
#$ashWednesdayDate->subtractSpan(new Date_Span('46, 0, 0, 0'));
$ashWednesdayDate = $this->_addDays($easterDate, -46 );
$this->_addHoliday('ashWednesday', $ashWednesdayDate, 'Ash Wednesday');
* Good Friday / Black Friday
#$goodFridayDate = new Date($easterDate);
#$goodFridayDate->subtractSpan(new Date_Span('2, 0, 0, 0'));
$goodFridayDate = $this->_addDays($easterDate, -2 );
$this->_addHoliday('goodFriday', $goodFridayDate, 'Good Friday');
$goodFridayDate->getPrevDay (),
$easterDate->getNextDay (),
#$triyDate = new Date($easterDate);
#$triyDate->addSpan(new Date_Span('49, 0, 0, 0'));
$triyDate = $this->_addDays($easterDate, 49 );
* Calculates date for Easter using the Gaussian algorithm.
//Use A variation of Gauss' algorithm
//http://www.smart.net/~mmontes/ortheast.html
$rb = 2 * $b + 4 * $c + 6 * $r4;
$rc = $r4 + $r5 + $julianOffset;
$offset = new Date (" $year-03-21" );
#$offset->addSpan(new Date_Span("$rc, 0, 0, 0"));
$offset = $this->_addDays($offset, $rc);
Documentation generated on Tue, 22 Jan 2013 01:00:08 +0000 by phpDocumentor 1.4.3. PEAR Logo Copyright © PHP Group 2004.
|