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

Source for file Netherlands.php

Documentation is available at Netherlands.php

  1. <?php
  2. /* vim: set expandtab tabstop=4 shiftwidth=4: */
  3. // +----------------------------------------------------------------------+
  4. // | PHP Version 4                                                        |
  5. // +----------------------------------------------------------------------+
  6. // | Copyright (c) 1997-2008 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:   Jos van der Woude <jos@veerkade.com>              |
  17. // +----------------------------------------------------------------------+
  18. //
  19. // $Id: Netherlands.php,v 1.2 2008/01/06 00:47:48 kguest Exp $
  20.  
  21. require_once 'Date/Holidays/Driver/Christian.php';
  22.  
  23. /**
  24.  * Driver class that calculates Dutch holidays
  25.  *
  26.  * @category    Date
  27.  * @package     Date_Holidays
  28.  * @subpackage  Driver
  29.  * @version     $Id: Netherlands.php,v 1.2 2008/01/06 00:47:48 kguest Exp $
  30.  * @author      Jos van der Woude <jos@veerkade.com>
  31.  */
  32.  
  33. {
  34.    /**
  35.     * Constructor
  36.     *
  37.     * Use the Date_Holidays::factory() method to construct an object of a certain driver
  38.     *
  39.     * @access   protected
  40.     */
  41.     function Date_Holidays_Driver_Netherlands({}
  42.  
  43.    /**
  44.     * Build the internal arrays that contain data about the calculated holidays
  45.     *
  46.     * @access   protected
  47.     * @return   boolean true on success, otherwise a PEAR_ErrorStack object
  48.     * @throws   object PEAR_ErrorStack
  49.     */
  50.     function _buildHolidays()
  51.     {
  52.        /**
  53.         * New Year's Day
  54.         */
  55.         $this->_addHoliday('newYearsDay'$this->_year . '-01-01''New Year\'s Day');
  56.         $this->_addTranslationForHoliday('newYearsDay''DU_NL''Nieuwjaarsdag');
  57.  
  58.        /**
  59.         * Epiphanias
  60.         */
  61.         $this->_addHoliday('epiphany'$this->_year . '-01-06''Epiphany');
  62.         $this->_addTranslationForHoliday('epiphany''DU_NL''Drie Koningen');
  63.  
  64.        /**
  65.     * Valentine's Day
  66.     */
  67.     $this->_addHoliday('valentineDay'$this->_year . '-02-14''Valentine\'s Day');
  68.     $this->_addTranslationForHoliday('valentineDay''DU_NL''Valentijnsdag');
  69.  
  70.        /**
  71.     * Queen's Day
  72.     */
  73.     $this->_addHoliday('queenDay'$this->_year . '-04-30''Queen\'s Day');
  74.     $this->_addTranslationForHoliday('queenDay''DU_NL''Koninginnedag');
  75.  
  76.        /**
  77.     * Commemoration Day Day
  78.     */
  79.     $this->_addHoliday('commemorationDay'$this->_year . '-05-04''Commemoration Day');
  80.     $this->_addTranslationForHoliday('commemorationDay''DU_NL''Dodenherdenking');
  81.  
  82.        /**
  83.     * Liberation Day
  84.     */
  85.     $this->_addHoliday('liberationDay'$this->_year . '-05-05''Liberation Day');
  86.     $this->_addTranslationForHoliday('liberationDay''DU_NL''Bevrijdingsdag');
  87.  
  88.  
  89.        /**
  90.         * Easter Sunday
  91.         */
  92.         $easterDate Date_Holidays_Driver_Christian::calcEaster($this->_year);
  93.         $this->_addHoliday('easter'$easterDate'Easter Sunday');
  94.         $this->_addTranslationForHoliday('easter''DU_NL''1e Paasdag');
  95.  
  96.        /**
  97.         * Easter Monday
  98.         */
  99.         $this->_addHoliday('easterMonday'$easterDate->getNextDay()'Easter Monday');
  100.         $this->_addTranslationForHoliday('easterMonday''DU_NL''2e Paasdag');
  101.  
  102.        /**
  103.         * Good Friday / Black Friday
  104.         */
  105.         $goodFridayDate = new Date($easterDate);
  106.         $goodFridayDate->subtractSpan(new Date_Span('2, 0, 0, 0'));
  107.         $this->_addHoliday('goodFriday'$goodFridayDate'Good Friday');
  108.         $this->_addTranslationForHoliday('goodFriday''DU_NL''Goede Vrijdag');
  109.  
  110.        /**
  111.         * Whitsun (determines Whit Monday, Ascension Day and Feast of Corpus Christi)
  112.         */
  113.         $whitsunDate = new Date($easterDate);
  114.         $whitsunDate->addSpan(new Date_Span('49, 0, 0, 0'));
  115.         $this->_addHoliday('whitsun'$whitsunDate'Whitsun');
  116.         $this->_addTranslationForHoliday('whitsun''DU_NL''1e Pinksterdag');
  117.  
  118.        /**
  119.         * Whit Monday
  120.         */
  121.         $this->_addHoliday('whitMonday'$whitsunDate->getNextDay()'Whit Monday');
  122.         $this->_addTranslationForHoliday('whitMonday''DU_NL''2e Pinksterdag');
  123.  
  124.        /**
  125.         * Ascension Day
  126.         */
  127.         $ascensionDayDate = new Date($whitsunDate);
  128.         $ascensionDayDate->subtractSpan(new Date_Span('10, 0, 0, 0'));
  129.         $this->_addHoliday('ascensionDay'$ascensionDayDate'Ascension Day');
  130.         $this->_addTranslationForHoliday('ascensionDay''DU_NL''Hemelvaartsdag');
  131.  
  132.        /**
  133.         * Christmas day
  134.         */
  135.         $this->_addHoliday('xmasDay'$this->_year . '-12-25''Christmas Day');
  136.         $this->_addTranslationForHoliday('xmasDay''DU_NL''1e Kerstdag');
  137.  
  138.        /**
  139.         * Second Christmas Day
  140.         */
  141.         $this->_addHoliday('secondXmasDay'$this->_year . '-12-26''Boxing Day');
  142.         $this->_addTranslationForHoliday('secondXmasDay''DU_NL''2e Kerstdag');
  143.  
  144.        /**
  145.         * New Year's Eve
  146.         */
  147.         $this->_addHoliday('newYearsEve'$this->_year . '-12-31''New Year\'s Eve');
  148.         $this->_addTranslationForHoliday('newYearsEve''DU_NL''Oudjaarsdag');
  149.  
  150.         if (Date_Holidays::errorsOccurred()) {
  151.             return Date_Holidays::getErrorStack();
  152.         }
  153.  
  154.         return true;
  155.     }
  156.  
  157.    /**
  158.     * Method that returns an array containing the ISO3166 codes that may possibly
  159.     * identify a driver.
  160.     * 
  161.     * @static
  162.     * @access public
  163.     * @return array possible ISO3166 codes
  164.     */
  165.     function getISO3166Codes({
  166.         return array('NL''NLD');
  167.     }
  168. }
  169. ?>

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