Source for file Sweden.php
Documentation is available at Sweden.php
/* vim: set expandtab tabstop=4 shiftwidth=4: */
* Driver for determining holidays in Sweden
* 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>
* @author Anders Karlsson <anders.x.karlsson@tdcsong.se>
* @license http://www.php.net/license/3_01.txt PHP License 3.0.1
* @version CVS: $Id: Sweden.php,v 1.11 2008/03/18 20:35:24 kguest Exp $
* @link http://pear.php.net/package/Date_Holidays
require_once 'Date/Holidays/Driver/Christian.php';
* Driver class that calculates Swedish holidays
* @author Anders Karlsson <anders.x.karlsson@tdcsong.se>
* @license http://www.php.net/license/3_01.txt PHP License 3.0.1
* @version CVS: $Id: Sweden.php,v 1.11 2008/03/18 20:35:24 kguest Exp $
* @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('easter', $easterDate, 'Easter Sunday');
* Good Friday / Black Friday
$goodFridayDate = new Date ($easterDate);
$goodFridayDate->subtractSpan (new Date_Span ('2, 0, 0, 0'));
$this->_addHoliday('goodFriday', $goodFridayDate, 'Good Friday');
$easterDate->getNextDay (),
* Pentecost (determines Whit Monday, Ascension Day and
* Feast of Corpus Christi)
$pentecostDate = new Date ($easterDate);
$pentecostDate->addSpan (new Date_Span ('49, 0, 0, 0'));
$this->_addHoliday('pentecost', $pentecostDate, 'Pentecost');
$ascensionDayDate = new Date ($pentecostDate);
$ascensionDayDate->subtractSpan (new Date_Span ('10, 0, 0, 0'));
$this->_addHoliday('ascensionDay', $ascensionDayDate, 'Ascension Day');
* Swedish National Day and the Swedish Flag's Day
'Swedish National Day and the Swedish Flag\'s Day');
* Saturday past 20th, June
$juneDate = new Date ($this->_year . '-06-20');
$dayOfWeek = $juneDate->getDayOfWeek ();
$juneDate->addSpan (new Date_Span (sprintf('%d, 0, 0, 0', 6 - $dayOfWeek)));
$midSummerDate = $juneDate;
$this->_addHoliday('midSummer', $midSummerDate, 'Midsummer Day');
$midSummerDate->getPrevDay (),
$saintspanDate = new Date ($this->_year . '-10-31');
$dayOfWeek = $saintspanDate->getDayOfWeek ();
$saintspanDate->addSpan (new Date_Span (sprintf('%d, 0, 0, 0',
$allSaintsDate = $saintspanDate;
$this->_addHoliday('allSaintsDay', $allSaintsDate, 'All Saints\' Day');
* Calculates the date for Easter. Actually this methods delegates the
* calculation to the {@link Date_Holidays_Driver_Christian#calcEaster()} method.
function calcEaster ($year)
* Method that returns an array containing the ISO3166 codes that may possibly
* @return array possible ISO3166 codes
return array ('se', 'swe');
Documentation generated on Thu, 10 Apr 2008 20:00:25 -0400 by phpDocumentor 1.4.0. PEAR Logo Copyright © PHP Group 2004.
|