Date_Holidays
[ class tree: Date_Holidays ] [ index: Date_Holidays ] [ all elements ]

Source for file Austria.php

Documentation is available at Austria.php

  1. <?php
  2. /* vim: set expandtab tabstop=4 shiftwidth=4: */
  3. // +----------------------------------------------------------------------+
  4. // | PHP Version 4                                                        |
  5. // +----------------------------------------------------------------------+
  6. // | Copyright (c) 1997-2002 The PHP Group                                |
  7. // +----------------------------------------------------------------------+
  8. // | This source file is subject to version 2.0 of the PHP license,       |
  9. // | that is bundled with this package in the file LICENSE, and is        |
  10. // | available at through the world-wide-web at                           |
  11. // | http://www.php.net/license/2_02.txt.                                 |
  12. // | If you did not receive a copy of the PHP license and are unable to   |
  13. // | obtain it through the world-wide-web, please send a note to          |
  14. // | license@php.net so we can mail you a copy immediately.               |
  15. // +----------------------------------------------------------------------+
  16. // | Authors:   Stephan Schmidt <schst@php-tools.net>                     |
  17. // |            Carsten Lucke <luckec@tool-garage.de>                     |
  18. // +----------------------------------------------------------------------+
  19. //
  20. //    $Id: Austria.php,v 1.1 2007/05/28 14:52:10 luckec Exp $
  21.  
  22. /**
  23.  * Requires Christian driver
  24.  */
  25. require_once 'Date/Holidays/Driver/Christian.php';
  26.  
  27. /**
  28.  * class that calculates Austrian holidays
  29.  *
  30.  * @category    Date
  31.  * @package     Date_Holidays
  32.  * @subpackage  Driver
  33.  * @version     $Id: Austria.php,v 1.1 2007/05/28 14:52:10 luckec Exp $
  34.  * @author      Klemens Ullmann <klemens@ull.at>
  35.  */
  36. {
  37.    /**
  38.     * Constructor
  39.     *
  40.     * Use the Date_Holidays::factory() method to construct an object of a certain driver
  41.     *
  42.     * @access   protected
  43.     */
  44.     function Date_Holidays_Driver_Austria()
  45.     {
  46.     }
  47.  
  48.    /**
  49.     * Build the internal arrays that contain data about the calculated holidays
  50.     *
  51.     * @access   protected
  52.     * @return   boolean true on success, otherwise a PEAR_ErrorStack object
  53.     * @throws   object PEAR_ErrorStack
  54.     */
  55.     function _buildHolidays()
  56.     {
  57.        /**
  58.         * New Year's Day
  59.         */
  60.         $this->_addHoliday('newYearsDay'$this->_year . '-01-01''Neujahr');
  61.  
  62.        /**
  63.         * Epiphanias
  64.         */
  65.         $this->_addHoliday('epiphany'$this->_year . '-01-06');
  66.  
  67.        /**
  68.         * Easter Sunday
  69.         */
  70.         $easterDate         Date_Holidays_Driver_Christian::calcEaster($this->_year);
  71.         $this->_addHoliday('easter'$easterDate'Ostersonntag');
  72.  
  73.        /**
  74.         * Easter Monday
  75.         */
  76.         $this->_addHoliday('easterMonday'$easterDate->getNextDay()'Ostermontag');
  77.  
  78.        /**
  79.         * Day of Work
  80.         */
  81.         $this->_addHoliday('dayOfWork'$this->_year . '-05-01''Tag der Arbeit');
  82.  
  83.        /**
  84.         * Whitsun (determines Whit Monday, Ascension Day and Feast of Corpus Christi)
  85.         */
  86.         $whitsunDate        = new Date($easterDate);
  87.         $whitsunDate->addSpan(new Date_Span('49, 0, 0, 0'));
  88.         $this->_addHoliday('whitsun'$whitsunDate'Pfingstsonntag');
  89.  
  90.        /**
  91.         * Ascension Day
  92.         */
  93.         $ascensionDayDate   = new Date($whitsunDate);
  94.         $ascensionDayDate->subtractSpan(new Date_Span('10, 0, 0, 0'));
  95.         $this->_addHoliday('ascensionDay'$ascensionDayDate'Christi Himmelfahrt');
  96.  
  97.        /**
  98.         * Whit Monday
  99.         */
  100.         $this->_addHoliday('whitMonday'$whitsunDate->getNextDay()'Pfingstmontag');
  101.  
  102.        /**
  103.         * Feast of Corpus Christi
  104.         */
  105.         $corpusChristiDate  = new Date($whitsunDate);
  106.         $corpusChristiDate->addSpan(new Date_Span('11, 0, 0, 0'));
  107.         $this->_addHoliday('corpusChristi'$corpusChristiDate'Fronleichnam');
  108.  
  109.        /**
  110.         * Ascension of Maria
  111.         */
  112.         $this->_addHoliday('mariaAscension'$this->_year . '-08-15''Maria Himmelfahrt');
  113.  
  114.        /**
  115.  
  116.         */
  117.         $this->_addHoliday('nationalDayAustria'$this->_year . '-10-26');
  118.  
  119.        /**
  120.         * All Saints' Day
  121.         */
  122.         $this->_addHoliday('allSaintsDay'$this->_year . '-11-01''Allerheiligen');
  123.  
  124.        /**
  125.         * Christmas day
  126.         */
  127.         $this->_addHoliday('xmasDay'$this->_year . '-12-25''1. Weihnachtsfeiertag');
  128.  
  129.        /**
  130.         * Boxing day
  131.         */
  132.         $this->_addHoliday('boxingDay'$this->_year . '-12-26''2. Weihnachtsfeiertag');
  133.  
  134.  
  135.         if (Date_Holidays::errorsOccurred()) {
  136.             return Date_Holidays::getErrorStack();
  137.         }
  138.         return true;
  139.     }
  140.  
  141.    /**
  142.     * Method that returns an array containing the ISO3166 codes that may possibly
  143.     * identify a driver.
  144.     *
  145.     * @static
  146.     * @access public
  147.     * @return array possible ISO3166 codes
  148.     */
  149.     function getISO3166Codes({
  150.         return array('at');
  151.     }
  152. }
  153. ?>

Documentation generated on Mon, 11 Mar 2019 15:03:05 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.