Source for file Turkey.php
Documentation is available at Turkey.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 Serkan Cetintopcu <sc@st.net.tr>
* @license http://www.php.net/license/3_01.txt PHP License 3.0.1
* @version CVS: $Id: Turkey.php,v 1.11 2008/03/17 11:37:49 kguest Exp $
* @link http://pear.php.net/package/Date_Holidays
* class that calculates observed Turkey holidays
* @author Serkan Cetintopcu <sc@st.net.tr>
* @license http://www.php.net/license/3_01.txt PHP License 3.0.1
* @version CVS: $Id: Turkey.php,v 1.11 2008/03/17 11:37:49 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
$newYearsDay = $this->_calcNearestWorkDay ('01', '01');
$this->_addHoliday ('newYearsDay', $newYearsDay, 'Yılbaşı');
$this->_addHoliday ('egemenlikDay', $this->_year. '-04-23', 'Ulusal Egemenlik ve Çocuk Bayramı');
$this->_addHoliday ('genclikDay', $this->_year. '-05-19', 'Atatürk\'ü Anma Gençlik ve Spor Bayramı');
$this->_addHoliday ('zaferDay', $this->_year. '-08-30', 'Zafer Bayramı');
$this->_addHoliday ('cumhuriyetDay', $this->_year. '-10-29', 'Cumhuriyet Bayramı');
function _calcNearestWorkDay ($month, $day)
$date = new Date ($this->_year . '-' . $month . '-' . $day);
// When one of these holidays falls on a Saturday, the previous day is
// When New Year's Day, Independence Day, or Christmas Day falls on a
// Sunday, the next day is also a holiday.
if ($date->getDayOfWeek () == 0 ) {
$date = $date->getNextDay ();
if ($date->getDayOfWeek () == 6 ) {
$date = $date->getPrevDay ();
return array ('tr', 'tur');
Documentation generated on Sun, 25 Nov 2012 01:30:01 +0000 by phpDocumentor 1.4.3. PEAR Logo Copyright © PHP Group 2004.
|