-
Notifications
You must be signed in to change notification settings - Fork 10
/
France.php
152 lines (137 loc) · 4.81 KB
/
France.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4: */
/**
* Driver for holidays in France
*
* PHP Version 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.
*
* @category Date
* @package Date_Holidays
* @author Stephan Schmidt <schst@php-tools.net>
* @author Carsten Lucke <luckec@tool-garage.de>
* @license http://www.php.net/license/3_01.txt PHP License 3.0.1
* @version CVS: $Id: France.php,v 1.13 2009/03/14 22:30:14 kguest Exp $
* @link http://pear.php.net/package/Date_Holidays
*/
/**
* Extends Christian driver
*/
require_once 'Date/Holidays/Driver/Christian.php';
/**
* class that calculates French holidays
*
* @category Date
* @package Date_Holidays
* @subpackage Driver
* @author Carsten Lucke <luckec@tool-garage.de>
* @author Stephan Schmidt <schst@php.net>
* @license http://www.php.net/license/3_01.txt PHP License 3.0.1
* @version CVS: $Id: France.php,v 1.13 2009/03/14 22:30:14 kguest Exp $
* @link http://pear.php.net/package/Date_Holidays
*/
class Date_Holidays_Driver_France extends Date_Holidays_Driver
{
/**
* this driver's name
*
* @access protected
* @var string
*/
var $_driverName = 'France';
/**
* Constructor
*
* Use the Date_Holidays::factory() method to construct an object of a
* certain driver
*
* @access protected
*/
protected function __construct()
{
}
/**
* Build the internal arrays that contain data about the calculated holidays
*
* @access protected
* @return boolean true on success, otherwise a PEAR_ErrorStack object
* @throws object PEAR_ErrorStack
*/
function _buildHolidays()
{
parent::_buildHolidays();
$this->_addHoliday('newYearsDay',
$this->_year . '-01-01',
'New Year\'s Day');
$this->_addHoliday('dayOfWork',
$this->_year . '-05-01',
'Day of Work');
$this->_addHoliday('VEDay',
$this->_year . '-05-08',
'Victory in Europe Day');
$this->_addHoliday('bastilleDay',
$this->_year . '-07-14',
'Bastille Day');
$this->_addHoliday('armisticeDay',
$this->_year . '-11-11',
'Armistice Day');
/* from Christian.php */
$easterDate = Date_Holidays_Driver_Christian::calcEaster($this->_year);
$this->_addHoliday('easterMonday',
$easterDate->getNextDay(),
'Easter Monday');
$whitsunDate = $this->_addDays($easterDate, 49);
$ascensionDayDate = $this->_addDays($whitsunDate, -10);
$this->_addHoliday('ascensionDay', $ascensionDayDate, 'Ascension Day');
$this->_addHoliday('whitMonday', $whitsunDate->getNextDay(), 'Whit Monday');
$this->_addHoliday('mariaAscension',
$this->_year . '-08-15',
'Ascension of Maria');
$this->_addHoliday('allSaintsDay',
$this->_year . '-11-01',
'All Saints\' Day');
$this->_addHoliday('christmasDay', $this->_year . '-12-25', 'Christmas Day');
$translations = array(
'newYearsDay' => "Jour de l'an",
'easterMonday' => "Lundi de Pâques",
'dayOfWork' => "Fête du travail",
'VEDay' => "Victoire de 1945",
'ascensionDay' => "Ascension",
'whitMonday' => "Lundi de Pentecôte",
'bastilleDay' => "Fête nationale",
'mariaAscension' => "Assomption",
'allSaintsDay' => "Toussaint",
'armisticeDay' => "Armistice de 1918",
'christmasDay' => "Noël",
);
foreach ($translations as $key => $text) {
$this->_addTranslationForHoliday($key, 'fr_FR', $text);
}
if (Date_Holidays::errorsOccurred()) {
return Date_Holidays::getErrorStack();
}
return true;
}
/**
* Method that returns an array containing the ISO3166 codes that may possibly
* identify a driver.
*
* @static
* @access public
* @return array possible ISO3166 codes
*/
function getISO3166Codes()
{
return array('fr');
}
}
?>