Source for file Serbia.php
Documentation is available at Serbia.php
/* vim: set expandtab tabstop=4 shiftwidth=4: */
* 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 Boban Acimovic <boban.acimovic@gmail.com>
* @license http://www.php.net/license/3_01.txt PHP License 3.0.1
* @link http://pear.php.net/package/Date_Holidays
* Driver class that calculates Serbian holidays
* @author Boban Acimovic <boban.acimovic@gmail.com>
* @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
* 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
$this->_addHoliday ('novagodina', $this->_year . '-01-01', 'Nova godina');
* Božić - Rođenje Gospoda Isusa Hrista
$this->_addHoliday ('bozic', $this->_year . '-01-07', 'Božić - Rođenje Gospoda Isusa Hrista');
* Sretenje - Dan državnosti Srbije
$this->_addHoliday ('sretenje', $this->_year . '-01-15', 'Sretenje - Dan državnosti Srbije');
$this->_addHoliday ('velikipetak', $this->_year . $this->_getGoodFriday (), 'Veliki petak');
$this->_addHoliday ('vaskrs', $this->_year . $this->_getEaster (), 'Vaskrsenje Gospoda Isusa Hrista');
$this->_addHoliday ('praznikrada', $this->_year . '-05-01', 'Praznik rada');
* Dan primirja u Prvom svetskom ratu
$this->_addHoliday ('danprimirja', $this->_year . '-11-11', 'Dan primirja u Prvom svetskom ratu');
if (Date_Holidays ::errorsOccurred ()) {
return Date_Holidays ::getErrorStack ();
* Helper method that Calculates Orthodox Easter date in Julian calendar
$d = (19 * $c + 15 ) % 30;
$e = (2 * $a + 4 * $b - $d + 34 ) % 7;
$month = floor(($d + $e + 114 ) / 31 );
$day = (($d + $e + 114 ) % 31 ) + 1;
return array ($month, $day);
* Helper method that returns formatted Orthodox Easter date
list ($month, $day) = $this->_calcEaster ();
// Add 13 days to convert from Julian to Gregorian calendar
* Helper method that returns formatted Orthodox Good Friday date
function _getGoodFriday ()
list ($month, $day) = $this->_calcEaster ();
// Add 13 days to convert from Julian to Gregorian calendar
// Remove 2 days to get Good Friday intead of Easter
* Method that returns an array containing the ISO3166 codes that may possibly
* @return array possible ISO3166 codes
return array ('rs', 'srb');
Documentation generated on Tue, 22 Jan 2013 01:00:04 +0000 by phpDocumentor 1.4.3. PEAR Logo Copyright © PHP Group 2004.
|