-
Notifications
You must be signed in to change notification settings - Fork 10
/
Croatia.php
158 lines (140 loc) · 3.98 KB
/
Croatia.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
153
154
155
156
157
158
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4: */
/**
* Driver for determining holidays in Croatia.
*
* PHP Version 5
*
* @category Date
* @package Date_Holidays
* @author Valentin Vidic <Valentin.Vidic@CARNet.hr>
* @license BSD http://www.opensource.org/licenses/bsd-license.php
* @version CVS: $Id: Croatia.php,v 1.8 2008/10/08 22:04:12 kguest Exp $
* @link http://pear.php.net/package/Date_Holidays
*/
require_once 'Date/Holidays/Driver/Christian.php';
/**
* Driver class that calculates Croatian holidays
*
* @category Date
* @package Date_Holidays
* @subpackage Driver
* @author Valentin Vidic <Valentin.Vidic@CARNet.hr>
* @license http://www.php.net/license/3_01.txt PHP License 3.0.1
* @version CVS: $Id: Croatia.php,v 1.8 2008/10/08 22:04:12 kguest Exp $
* @link http://pear.php.net/package/Date_Holidays
*/
class Date_Holidays_Driver_Croatia extends Date_Holidays_Driver
{
/**
* 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()
{
/**
* New Year's Day
*/
$this->_addHoliday('novagodina', $this->_year . '-01-01', 'Nova godina');
/**
* Sveta tri kralja
*/
$this->_addHoliday('trikralja', $this->_year . '-01-06', 'Sveta tri kralja');
/**
* Easter Sunday
*/
$easter = Date_Holidays_Driver_Christian::calcEaster($this->_year);
$this->_addHoliday('uskrs', $easter, 'Uskrs');
/**
* Easter Monday
*/
$easterMon = clone $easter;
$easterMon->day++;
$this->_addHoliday('uskrspon', $easterMon, 'Uskršnji ponedjeljak');
/**
* Praznik rada
*/
$this->_addHoliday('rada', $this->_year . '-05-01', 'Praznik rada');
/**
* Tijelovo
*/
$easterMon = clone $easter;
$easterMon->day+=60;
$this->_addHoliday('Tijelovo', $easterMon, 'Tijelovo');
/**
* Dan antifašističke borbe
*/
$this->_addHoliday(
'antifasizma',
$this->_year . '-06-22',
'Dan antifašističke borbe'
);
/**
* Dan državnosti
*/
$this->_addHoliday('drzavnosti', $this->_year . '-06-25', 'Dan državnosti');
/**
* Dan domovinske zahvalnosti
*/
$this->_addHoliday(
'zahvalnosti',
$this->_year . '-08-05',
'Dan domovinske zahvalnosti'
);
/**
* Velika Gospa
*/
$this->_addHoliday('gospa', $this->_year . '-08-15', 'Velika Gospa');
/**
* Dan neovisnosti
*/
$this->_addHoliday(
'neovisnosti',
$this->_year . '-10-08',
'Dan neovisnosti'
);
/**
* Dan svih svetih
*/
$this->_addHoliday('svisveti', $this->_year . '-11-01', 'Dan svih svetih');
/**
* Božić
*/
$this->_addHoliday('bozic', $this->_year . '-12-25', 'Božić');
/**
* Sveti Stjepan
*/
$this->_addHoliday('svetistjepan', $this->_year . '-12-26', 'Sveti Stjepan');
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('hr', 'hrv');
}
}
?>