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.  * Driver for determining holidays in Ireland.
  5.  *
  6.  * PHP Version 4
  7.  *
  8.  * Copyright (c) 1997-2008 The PHP Group
  9.  *
  10.  * This source file is subject to version 3.0 of the PHP license,
  11.  * that is bundled with this package in the file LICENSE, and is
  12.  * available at through the world-wide-web at
  13.  * http://www.php.net/license/3_01.txt.
  14.  * If you did not receive a copy of the PHP license and are unable to
  15.  * obtain it through the world-wide-web, please send a note to
  16.  * license@php.net so we can mail you a copy immediately.
  17.  *
  18.  * @category Date
  19.  * @package  Date_Holidays
  20.  * @author   Jos van der Woude <jos@veerkade.com>
  21.  * @license  http://www.php.net/license/3_01.txt PHP License 3.0.1
  22.  * @version  CVS: $Id: Netherlands.php,v 1.5 2008/03/18 20:35:24 kguest Exp $
  23.  * @link     http://pear.php.net/package/Date_Holidays
  24.  */
  25.  
  26. require_once 'Date/Holidays/Driver/Christian.php';
  27.  
  28. /**
  29.  * Driver class that calculates Dutch holidays
  30.  *
  31.  * @category   Date
  32.  * @package    Date_Holidays
  33.  * @subpackage Driver
  34.  * @author     Jos van der Woude <jos@veerkade.com>
  35.  * @license    http://www.php.net/license/3_01.txt PHP License 3.0.1
  36.  * @version    $Id: Netherlands.php,v 1.5 2008/03/18 20:35:24 kguest Exp $
  37.  * @link       http://pear.php.net/package/Date_Holidays
  38.  */
  39.  
  40. {
  41.     /**
  42.      * Constructor
  43.      *
  44.      * Use the Date_Holidays::factory() method to construct an object of a
  45.      * certain driver
  46.      *
  47.      * @access protected
  48.      */
  49.     {
  50.     }
  51.  
  52.     /**
  53.      * Build the internal arrays that contain data about the calculated holidays
  54.      *
  55.      * @access protected
  56.      * @return boolean true on success, otherwise a PEAR_ErrorStack object
  57.      * @throws object PEAR_ErrorStack
  58.      */
  59.     function _buildHolidays()
  60.     {
  61.         /**
  62.          * New Year's Day
  63.          */
  64.         $this->_addHoliday('newYearsDay',
  65.                            $this->_year . '-01-01',
  66.                            'New Year\'s Day');
  67.         $this->_addTranslationForHoliday('newYearsDay''DU_NL''Nieuwjaarsdag');
  68.  
  69.         /**
  70.          * Epiphanias
  71.          */
  72.         $this->_addHoliday('epiphany'$this->_year . '-01-06''Epiphany');
  73.         $this->_addTranslationForHoliday('epiphany''DU_NL''Drie Koningen');
  74.  
  75.         /**
  76.          * Valentine's Day
  77.          */
  78.         $this->_addHoliday('valentineDay',
  79.                            $this->_year . '-02-14',
  80.                            'Valentine\'s Day');
  81.         $this->_addTranslationForHoliday('valentineDay''DU_NL''Valentijnsdag');
  82.  
  83.         /**
  84.          * Queen's Day
  85.          */
  86.         $this->_addHoliday('queenDay'$this->_year . '-04-30''Queen\'s Day');
  87.         $this->_addTranslationForHoliday('queenDay''DU_NL''Koninginnedag');
  88.  
  89.         /**
  90.          * Commemoration Day Day
  91.          */
  92.         $this->_addHoliday('commemorationDay',
  93.                            $this->_year . '-05-04',
  94.                            'Commemoration Day');
  95.         $this->_addTranslationForHoliday('commemorationDay',
  96.                                          'DU_NL',
  97.                                          'Dodenherdenking');
  98.  
  99.         /**
  100.          * Liberation Day
  101.          */
  102.         $this->_addHoliday('liberationDay',
  103.                            $this->_year . '-05-05',
  104.                            'Liberation Day');
  105.         $this->_addTranslationForHoliday('liberationDay''DU_NL''Bevrijdingsdag');
  106.  
  107.  
  108.         /**
  109.          * Easter Sunday
  110.          */
  111.         $easterDate Date_Holidays_Driver_Christian::calcEaster($this->_year);
  112.         $this->_addHoliday('easter'$easterDate'Easter Sunday');
  113.         $this->_addTranslationForHoliday('easter''DU_NL''1e Paasdag');
  114.  
  115.         /**
  116.          * Easter Monday
  117.          */
  118.         $this->_addHoliday('easterMonday',
  119.                            $easterDate->getNextDay(),
  120.                            'Easter Monday');
  121.         $this->_addTranslationForHoliday('easterMonday''DU_NL''2e Paasdag');
  122.  
  123.         /**
  124.          * Good Friday / Black Friday
  125.          */
  126.         $goodFridayDate = new Date($easterDate);
  127.         $goodFridayDate->subtractSpan(new Date_Span('2, 0, 0, 0'));
  128.         $this->_addHoliday('goodFriday'$goodFridayDate'Good Friday');
  129.         $this->_addTranslationForHoliday('goodFriday''DU_NL''Goede Vrijdag');
  130.  
  131.         /**
  132.          * Whitsun (determines Whit Monday, Ascension Day and Feast of
  133.          * Corpus Christi)
  134.          */
  135.         $whitsunDate = new Date($easterDate);
  136.         $whitsunDate->addSpan(new Date_Span('49, 0, 0, 0'));
  137.         $this->_addHoliday('whitsun'$whitsunDate'Whitsun');
  138.         $this->_addTranslationForHoliday('whitsun''DU_NL''1e Pinksterdag');
  139.  
  140.         /**
  141.          * Whit Monday
  142.          */
  143.         $this->_addHoliday('whitMonday'$whitsunDate->getNextDay()'Whit Monday');
  144.         $this->_addTranslationForHoliday('whitMonday''DU_NL''2e Pinksterdag');
  145.  
  146.         /**
  147.          * Ascension Day
  148.          */
  149.         $ascensionDayDate = new Date($whitsunDate);
  150.         $ascensionDayDate->subtractSpan(new Date_Span('10, 0, 0, 0'));
  151.         $this->_addHoliday('ascensionDay'$ascensionDayDate'Ascension Day');
  152.         $this->_addTranslationForHoliday('ascensionDay''DU_NL''Hemelvaartsdag');
  153.  
  154.         /**
  155.          * Christmas day
  156.          */
  157.         $this->_addHoliday('christmasDay'$this->_year . '-12-25''Christmas Day');
  158.         $this->_addTranslationForHoliday('christmasDay''DU_NL''1e Kerstdag');
  159.  
  160.         /**
  161.          * Second Christmas Day
  162.          */
  163.         $this->_addHoliday('secondChristmasDay'$this->_year . '-12-26''Boxing Day');
  164.         $this->_addTranslationForHoliday('secondChristmasDay''DU_NL''2e Kerstdag');
  165.  
  166.         /**
  167.          * New Year's Eve
  168.          */
  169.         $this->_addHoliday('newYearsEve'$this->_year . '-12-31'"New Year's Eve");
  170.         $this->_addTranslationForHoliday('newYearsEve''DU_NL''Oudjaarsdag');
  171.  
  172.         if (Date_Holidays::errorsOccurred()) {
  173.             return Date_Holidays::getErrorStack();
  174.         }
  175.  
  176.         return true;
  177.     }
  178.  
  179.     /**
  180.      * Method that returns an array containing the ISO3166 codes that may possibly
  181.      * identify a driver.
  182.      *
  183.      * @static
  184.      * @access public
  185.      * @return array possible ISO3166 codes
  186.      */
  187.     function getISO3166Codes()
  188.     {
  189.         return array('NL''NLD');
  190.     }
  191. }
  192. ?>

Documentation generated on Thu, 10 Apr 2008 20:00:21 -0400 by phpDocumentor 1.4.0. PEAR Logo Copyright © PHP Group 2004.