| 1 | <?php |
|---|
| 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 | require_once 'Date/Holidays/Driver.php'; |
|---|
| 31 | |
|---|
| 32 | |
|---|
| 33 | |
|---|
| 34 | |
|---|
| 35 | |
|---|
| 36 | |
|---|
| 37 | |
|---|
| 38 | define('DATE_HOLIDAYS_EQUINOX_GRADIENT', 0.242194); |
|---|
| 39 | |
|---|
| 40 | |
|---|
| 41 | |
|---|
| 42 | |
|---|
| 43 | |
|---|
| 44 | |
|---|
| 45 | |
|---|
| 46 | define('DATE_HOLIDAYS_VERNAL_EQUINOX_PARAM_1979', 20.8357); |
|---|
| 47 | |
|---|
| 48 | |
|---|
| 49 | |
|---|
| 50 | |
|---|
| 51 | |
|---|
| 52 | |
|---|
| 53 | |
|---|
| 54 | define('DATE_HOLIDAYS_VERNAL_EQUINOX_PARAM_2099', 20.8431); |
|---|
| 55 | |
|---|
| 56 | |
|---|
| 57 | |
|---|
| 58 | |
|---|
| 59 | |
|---|
| 60 | |
|---|
| 61 | |
|---|
| 62 | define('DATE_HOLIDAYS_VERNAL_EQUINOX_PARAM_2150', 21.8510); |
|---|
| 63 | |
|---|
| 64 | |
|---|
| 65 | |
|---|
| 66 | |
|---|
| 67 | |
|---|
| 68 | |
|---|
| 69 | |
|---|
| 70 | define('DATE_HOLIDAYS_AUTUMNAL_EQUINOX_PARAM_1979', 23.2588); |
|---|
| 71 | |
|---|
| 72 | |
|---|
| 73 | |
|---|
| 74 | |
|---|
| 75 | |
|---|
| 76 | |
|---|
| 77 | |
|---|
| 78 | define('DATE_HOLIDAYS_AUTUMNAL_EQUINOX_PARAM_2099', 23.2488); |
|---|
| 79 | |
|---|
| 80 | |
|---|
| 81 | |
|---|
| 82 | |
|---|
| 83 | |
|---|
| 84 | |
|---|
| 85 | |
|---|
| 86 | define('DATE_HOLIDAYS_AUTUMNAL_EQUINOX_PARAM_2150', 24.2488); |
|---|
| 87 | |
|---|
| 88 | |
|---|
| 89 | |
|---|
| 90 | |
|---|
| 91 | |
|---|
| 92 | |
|---|
| 93 | |
|---|
| 94 | |
|---|
| 95 | |
|---|
| 96 | |
|---|
| 97 | |
|---|
| 98 | |
|---|
| 99 | |
|---|
| 100 | class Date_Holidays_Driver_Japanese extends Date_Holidays_Driver |
|---|
| 101 | { |
|---|
| 102 | |
|---|
| 103 | |
|---|
| 104 | |
|---|
| 105 | |
|---|
| 106 | |
|---|
| 107 | var $_translationFile = null; |
|---|
| 108 | |
|---|
| 109 | |
|---|
| 110 | |
|---|
| 111 | |
|---|
| 112 | |
|---|
| 113 | |
|---|
| 114 | var $_translationLocale = null; |
|---|
| 115 | |
|---|
| 116 | |
|---|
| 117 | |
|---|
| 118 | |
|---|
| 119 | |
|---|
| 120 | |
|---|
| 121 | |
|---|
| 122 | |
|---|
| 123 | |
|---|
| 124 | function Date_Holidays_Driver_Japanese() |
|---|
| 125 | { |
|---|
| 126 | } |
|---|
| 127 | |
|---|
| 128 | |
|---|
| 129 | |
|---|
| 130 | |
|---|
| 131 | |
|---|
| 132 | |
|---|
| 133 | |
|---|
| 134 | |
|---|
| 135 | function _buildHolidays() |
|---|
| 136 | { |
|---|
| 137 | parent::_buildHolidays(); |
|---|
| 138 | |
|---|
| 139 | $this->_clearHolidays(); |
|---|
| 140 | |
|---|
| 141 | $this->_buildNewYearsDay(); |
|---|
| 142 | $this->_buildComingofAgeDay(); |
|---|
| 143 | $this->_buildNationalFoundationDay(); |
|---|
| 144 | $this->_buildVernalEquinoxDay(); |
|---|
| 145 | $this->_buildShowaDay(); |
|---|
| 146 | $this->_buildConstitutionMemorialDay(); |
|---|
| 147 | $this->_buildGreeneryDay(); |
|---|
| 148 | $this->_buildChildrensDay(); |
|---|
| 149 | $this->_buildMarineDay(); |
|---|
| 150 | $this->_buildRespectfortheAgedDay(); |
|---|
| 151 | $this->_buildAutumnalEquinoxDay(); |
|---|
| 152 | $this->_buildHealthandSportsDay(); |
|---|
| 153 | $this->_buildNationalCultureDay(); |
|---|
| 154 | $this->_buildLaborThanksgivingDay(); |
|---|
| 155 | $this->_buildEmperorsBirthday(); |
|---|
| 156 | |
|---|
| 157 | $this->_buildOtherMemorialDays(); |
|---|
| 158 | |
|---|
| 159 | $this->_buildSubstituteHolidays(); |
|---|
| 160 | |
|---|
| 161 | return true; |
|---|
| 162 | } |
|---|
| 163 | |
|---|
| 164 | |
|---|
| 165 | |
|---|
| 166 | |
|---|
| 167 | |
|---|
| 168 | |
|---|
| 169 | |
|---|
| 170 | |
|---|
| 171 | |
|---|
| 172 | function getISO3166Codes() |
|---|
| 173 | { |
|---|
| 174 | return array('jp', 'jpn'); |
|---|
| 175 | } |
|---|
| 176 | |
|---|
| 177 | |
|---|
| 178 | |
|---|
| 179 | |
|---|
| 180 | |
|---|
| 181 | |
|---|
| 182 | |
|---|
| 183 | function _buildNewYearsDay() |
|---|
| 184 | { |
|---|
| 185 | if ($this->_year >= 1949) { |
|---|
| 186 | $this->_addHoliday('newYearsDay', |
|---|
| 187 | $this->_year . '-01-01', |
|---|
| 188 | 'New Year\'s Day'); |
|---|
| 189 | } |
|---|
| 190 | } |
|---|
| 191 | |
|---|
| 192 | |
|---|
| 193 | |
|---|
| 194 | |
|---|
| 195 | |
|---|
| 196 | |
|---|
| 197 | |
|---|
| 198 | function _buildComingofAgeDay() |
|---|
| 199 | { |
|---|
| 200 | $date = null; |
|---|
| 201 | if ($this->_year >= 2000) { |
|---|
| 202 | $date = $this->_calcNthMondayInMonth(1, 2); |
|---|
| 203 | } else if ($this->_year >= 1949) { |
|---|
| 204 | $date = $this->_year . '-01-15'; |
|---|
| 205 | } |
|---|
| 206 | if (!is_null($date)) { |
|---|
| 207 | $this->_addHoliday('comingOfAgeDay', |
|---|
| 208 | $date, |
|---|
| 209 | 'Coming of Age Day'); |
|---|
| 210 | } |
|---|
| 211 | } |
|---|
| 212 | |
|---|
| 213 | |
|---|
| 214 | |
|---|
| 215 | |
|---|
| 216 | |
|---|
| 217 | |
|---|
| 218 | |
|---|
| 219 | function _buildNationalFoundationDay() |
|---|
| 220 | { |
|---|
| 221 | if ($this->_year >= 1949) { |
|---|
| 222 | $this->_addHoliday('nationalFoundationDay', |
|---|
| 223 | $this->_year . '-02-11', |
|---|
| 224 | 'National Foundation Day'); |
|---|
| 225 | } |
|---|
| 226 | } |
|---|
| 227 | |
|---|
| 228 | |
|---|
| 229 | |
|---|
| 230 | |
|---|
| 231 | |
|---|
| 232 | |
|---|
| 233 | |
|---|
| 234 | |
|---|
| 235 | |
|---|
| 236 | |
|---|
| 237 | function _buildVernalEquinoxDay() |
|---|
| 238 | { |
|---|
| 239 | $day = null; |
|---|
| 240 | if ($this->_year >= 1948 && $this->_year <= 1979) { |
|---|
| 241 | $day = floor(DATE_HOLIDAYS_VERNAL_EQUINOX_PARAM_1979 + |
|---|
| 242 | DATE_HOLIDAYS_EQUINOX_GRADIENT * |
|---|
| 243 | ($this->_year - 1980) - |
|---|
| 244 | floor(($this->_year - 1980) / 4)); |
|---|
| 245 | } else if ($this->_year <= 2099) { |
|---|
| 246 | $day = floor(DATE_HOLIDAYS_VERNAL_EQUINOX_PARAM_2099 + |
|---|
| 247 | DATE_HOLIDAYS_EQUINOX_GRADIENT * |
|---|
| 248 | ($this->_year - 1980) - |
|---|
| 249 | floor(($this->_year - 1980) / 4)); |
|---|
| 250 | } else if ($this->_year <= 2150) { |
|---|
| 251 | $day = floor(DATE_HOLIDAYS_VERNAL_EQUINOX_PARAM_2150 + |
|---|
| 252 | DATE_HOLIDAYS_EQUINOX_GRADIENT * |
|---|
| 253 | ($this->_year - 1980) - |
|---|
| 254 | floor(($this->_year - 1980) / 4)); |
|---|
| 255 | } |
|---|
| 256 | if (!is_null($day)) { |
|---|
| 257 | $this->_addHoliday('Vernal Equinox Day', |
|---|
| 258 | sprintf('%04d-%02d-%02d', $this->_year, 3, $day), |
|---|
| 259 | 'Vernal Equinox Day'); |
|---|
| 260 | } |
|---|
| 261 | } |
|---|
| 262 | |
|---|
| 263 | |
|---|
| 264 | |
|---|
| 265 | |
|---|
| 266 | |
|---|
| 267 | |
|---|
| 268 | |
|---|
| 269 | function _buildShowaDay() |
|---|
| 270 | { |
|---|
| 271 | $name = null; |
|---|
| 272 | if ($this->_year >= 2007) { |
|---|
| 273 | $name = 'Showa Day'; |
|---|
| 274 | } else if ($this->_year >= 1989) { |
|---|
| 275 | $name = 'Greenery Day'; |
|---|
| 276 | } else if ($this->_year >= 1949) { |
|---|
| 277 | $name = 'Showa Emperor\'s Birthday'; |
|---|
| 278 | } |
|---|
| 279 | if (!is_null($name)) { |
|---|
| 280 | $this->_addHoliday('showaDay', |
|---|
| 281 | $this->_year . '-04-29', |
|---|
| 282 | $name); |
|---|
| 283 | } |
|---|
| 284 | } |
|---|
| 285 | |
|---|
| 286 | |
|---|
| 287 | |
|---|
| 288 | |
|---|
| 289 | |
|---|
| 290 | |
|---|
| 291 | |
|---|
| 292 | function _buildConstitutionMemorialDay() |
|---|
| 293 | { |
|---|
| 294 | if ($this->_year >= 1949) { |
|---|
| 295 | $this->_addHoliday('constitutionMemorialDay', |
|---|
| 296 | $this->_year . '-05-03', |
|---|
| 297 | 'Constitution Memorial Day'); |
|---|
| 298 | } |
|---|
| 299 | } |
|---|
| 300 | |
|---|
| 301 | |
|---|
| 302 | |
|---|
| 303 | |
|---|
| 304 | |
|---|
| 305 | |
|---|
| 306 | |
|---|
| 307 | function _buildGreeneryDay() |
|---|
| 308 | { |
|---|
| 309 | $name = null; |
|---|
| 310 | if ($this->_year >= 2007) { |
|---|
| 311 | $name = 'Greenery Day'; |
|---|
| 312 | } else if ($this->_year >= 1986) { |
|---|
| 313 | $date =& new Date($this->_year . '-05-04'); |
|---|
| 314 | if ($date->getDayOfWeek() != 0) { |
|---|
| 315 | $name = 'National Holiday'; |
|---|
| 316 | } |
|---|
| 317 | } |
|---|
| 318 | if (!is_null($name)) { |
|---|
| 319 | $this->_addHoliday('greeneryDay', |
|---|
| 320 | $this->_year . '-05-04', |
|---|
| 321 | $name); |
|---|
| 322 | } |
|---|
| 323 | } |
|---|
| 324 | |
|---|
| 325 | |
|---|
| 326 | |
|---|
| 327 | |
|---|
| 328 | |
|---|
| 329 | |
|---|
| 330 | |
|---|
| 331 | function _buildChildrensDay() |
|---|
| 332 | { |
|---|
| 333 | if ($this->_year >= 1949) { |
|---|
| 334 | $this->_addHoliday('childrensDay', |
|---|
| 335 | $this->_year . '-05-05', |
|---|
| 336 | 'Children\'s Day'); |
|---|
| 337 | } |
|---|
| 338 | } |
|---|
| 339 | |
|---|
| 340 | |
|---|
| 341 | |
|---|
| 342 | |
|---|
| 343 | |
|---|
| 344 | |
|---|
| 345 | |
|---|
| 346 | function _buildMarineDay() |
|---|
| 347 | { |
|---|
| 348 | $date = null; |
|---|
| 349 | if ($this->_year >= 2003) { |
|---|
| 350 | $date = $this->_calcNthMondayInMonth(7, 3); |
|---|
| 351 | } else if ($this->_year >= 1996) { |
|---|
| 352 | $date = $this->_year . '-07-20'; |
|---|
| 353 | } |
|---|
| 354 | if (!is_null($date)) { |
|---|
| 355 | $this->_addHoliday('marineDay', |
|---|
| 356 | $date, |
|---|
| 357 | 'Marine Day'); |
|---|
| 358 | } |
|---|
| 359 | } |
|---|
| 360 | |
|---|
| 361 | |
|---|
| 362 | |
|---|
| 363 | |
|---|
| 364 | |
|---|
| 365 | |
|---|
| 366 | |
|---|
| 367 | function _buildRespectfortheAgedDay() |
|---|
| 368 | { |
|---|
| 369 | $date = null; |
|---|
| 370 | if ($this->_year >= 2003) { |
|---|
| 371 | $date = $this->_calcNthMondayInMonth(9, 3); |
|---|
| 372 | } else if ($this->_year >= 1966) { |
|---|
| 373 | $date = $this->_year . '-09-15'; |
|---|
| 374 | } |
|---|
| 375 | if (!is_null($date)) { |
|---|
| 376 | $this->_addHoliday('respectfortheAgedDay', |
|---|
| 377 | $date, |
|---|
| 378 | 'Respect for the Aged Day'); |
|---|
| 379 | } |
|---|
| 380 | } |
|---|
| 381 | |
|---|
| 382 | |
|---|
| 383 | |
|---|
| 384 | |
|---|
| 385 | |
|---|
| 386 | |
|---|
| 387 | |
|---|
| 388 | function _buildHealthandSportsDay() |
|---|
| 389 | { |
|---|
| 390 | $date = null; |
|---|
| 391 | if ($this->_year >= 2000) { |
|---|
| 392 | $date = $this->_calcNthMondayInMonth(10, 2); |
|---|
| 393 | } else if ($this->_year >= 1966) { |
|---|
| 394 | $date = $this->_year . '-10-10'; |
|---|
| 395 | } |
|---|
| 396 | if (!is_null($date)) { |
|---|
| 397 | $this->_addHoliday('healthandSportsDay', |
|---|
| 398 | $date, |
|---|
| 399 | 'Health and Sports Day'); |
|---|
| 400 | } |
|---|
| 401 | } |
|---|
| 402 | |
|---|
| 403 | |
|---|
| 404 | |
|---|
| 405 | |
|---|
| 406 | |
|---|
| 407 | |
|---|
| 408 | |
|---|
| 409 | |
|---|
| 410 | |
|---|
| 411 | |
|---|
| 412 | function _buildAutumnalEquinoxDay() |
|---|
| 413 | { |
|---|
| 414 | $day = null; |
|---|
| 415 | if ($this->_year >= 1948 && $this->_year <= 1979) { |
|---|
| 416 | $day = floor(DATE_HOLIDAYS_AUTUMNAL_EQUINOX_PARAM_1979 + |
|---|
| 417 | DATE_HOLIDAYS_EQUINOX_GRADIENT * |
|---|
| 418 | ($this->_year - 1980) - |
|---|
| 419 | floor(($this->_year - 1980) / 4)); |
|---|
| 420 | } else if ($this->_year <= 2099) { |
|---|
| 421 | $day = floor(DATE_HOLIDAYS_AUTUMNAL_EQUINOX_PARAM_2099 + |
|---|
| 422 | DATE_HOLIDAYS_EQUINOX_GRADIENT * |
|---|
| 423 | ($this->_year - 1980) - |
|---|
| 424 | floor(($this->_year - 1980) / 4)); |
|---|
| 425 | } else if ($this->_year <= 2150) { |
|---|
| 426 | $day = floor(DATE_HOLIDAYS_AUTUMNAL_EQUINOX_PARAM_2150 + |
|---|
| 427 | DATE_HOLIDAYS_EQUINOX_GRADIENT * |
|---|
| 428 | ($this->_year - 1980) - |
|---|
| 429 | floor(($this->_year - 1980) / 4)); |
|---|
| 430 | } |
|---|
| 431 | if (!is_null($day)) { |
|---|
| 432 | $this->_addHoliday('autumnalEquinoxDay', |
|---|
| 433 | sprintf('%04d-%02d-%02d', $this->_year, 9, $day), |
|---|
| 434 | 'Autumnal Equinox Day'); |
|---|
| 435 | |
|---|
| 436 | if ($this->_year >= 2003 && |
|---|
| 437 | $this->getHolidayDate('autumnalEquinoxDay')->getDayOfWeek() == 3) { |
|---|
| 438 | $this->_addHoliday('nationalHolidayBeforeAutumnalEquinoxDay', |
|---|
| 439 | $this->getHolidayDate('autumnalEquinoxDay')->getPrevDay(), |
|---|
| 440 | 'National Holiday before Autumnal Equinox Day'); |
|---|
| 441 | } |
|---|
| 442 | } |
|---|
| 443 | } |
|---|
| 444 | |
|---|
| 445 | |
|---|
| 446 | |
|---|
| 447 | |
|---|
| 448 | |
|---|
| 449 | |
|---|
| 450 | |
|---|
| 451 | function _buildNationalCultureDay() |
|---|
| 452 | { |
|---|
| 453 | if ($this->_year >= 1948) { |
|---|
| 454 | $this->_addHoliday('nationalCultureDay', |
|---|
| 455 | $this->_year . '-11-03', |
|---|
| 456 | 'National Culture Day'); |
|---|
| 457 | } |
|---|
| 458 | } |
|---|
| 459 | |
|---|
| 460 | |
|---|
| 461 | |
|---|
| 462 | |
|---|
| 463 | |
|---|
| 464 | |
|---|
| 465 | |
|---|
| 466 | function _buildLaborThanksgivingDay() |
|---|
| 467 | { |
|---|
| 468 | if ($this->_year >= 1948) { |
|---|
| 469 | $this->_addHoliday('laborThanksgivingDay', |
|---|
| 470 | $this->_year . '-11-23', |
|---|
| 471 | 'Labor Thanksgiving Day'); |
|---|
| 472 | } |
|---|
| 473 | } |
|---|
| 474 | |
|---|
| 475 | |
|---|
| 476 | |
|---|
| 477 | |
|---|
| 478 | |
|---|
| 479 | |
|---|
| 480 | |
|---|
| 481 | function _buildEmperorsBirthday() |
|---|
| 482 | { |
|---|
| 483 | if ($this->_year >= 1989) { |
|---|
| 484 | $this->_addHoliday('emperorsBirthday', |
|---|
| 485 | $this->_year . '-12-23', |
|---|
| 486 | 'Emperor\'s Birthday'); |
|---|
| 487 | } |
|---|
| 488 | } |
|---|
| 489 | |
|---|
| 490 | |
|---|
| 491 | |
|---|
| 492 | |
|---|
| 493 | |
|---|
| 494 | |
|---|
| 495 | |
|---|
| 496 | function _buildOtherMemorialDays() |
|---|
| 497 | { |
|---|
| 498 | if ($this->_year == 1959) { |
|---|
| 499 | $this->_addHoliday('theRiteofWeddingofHIHCrownPrinceAkihito', |
|---|
| 500 | $this->_year . '-04-10', |
|---|
| 501 | 'The Rite of Wedding of HIH Crown Prince Akihito'); |
|---|
| 502 | } |
|---|
| 503 | if ($this->_year == 1989) { |
|---|
| 504 | $this->_addHoliday('theFuneralCeremonyofEmperorShowa.', |
|---|
| 505 | $this->_year . '-02-24', |
|---|
| 506 | 'The Funeral Ceremony of Emperor Showa.'); |
|---|
| 507 | } |
|---|
| 508 | if ($this->_year == 1990) { |
|---|
| 509 | $this->_addHoliday('theCeremonyoftheEnthronementofHisMajestytheEmperor(attheSeiden)', |
|---|
| 510 | $this->_year . '-11-12', |
|---|
| 511 | 'The Ceremony of the Enthronement of His Majesty the Emperor (at the Seiden)'); |
|---|
| 512 | } |
|---|
| 513 | if ($this->_year == 1993) { |
|---|
| 514 | $this->_addHoliday('theRiteofWeddingofHIHCrownPrinceNaruhito', |
|---|
| 515 | $this->_year . '-06-09', |
|---|
| 516 | 'The Rite of Wedding of HIH Crown Prince Naruhito'); |
|---|
| 517 | } |
|---|
| 518 | } |
|---|
| 519 | |
|---|
| 520 | |
|---|
| 521 | |
|---|
| 522 | |
|---|
| 523 | |
|---|
| 524 | |
|---|
| 525 | |
|---|
| 526 | function _buildSubstituteHolidays() |
|---|
| 527 | { |
|---|
| 528 | |
|---|
| 529 | foreach ($this->_dates as $internalName => $date) { |
|---|
| 530 | if ($date->getDayOfWeek() == 0) { |
|---|
| 531 | if ($this->_year >= 2007) { |
|---|
| 532 | while (in_array($date, $this->_dates)) { |
|---|
| 533 | $date = $date->getNextDay(); |
|---|
| 534 | } |
|---|
| 535 | } else if ($date->getDate() >= '1973-04-12') { |
|---|
| 536 | $date = $date->getNextDay(); |
|---|
| 537 | if (in_array($date, $this->_dates)) { |
|---|
| 538 | continue; |
|---|
| 539 | } |
|---|
| 540 | } else { |
|---|
| 541 | continue; |
|---|
| 542 | } |
|---|
| 543 | if (!is_null($date)) { |
|---|
| 544 | $name = 'substituteHolidayFor' . $internalName; |
|---|
| 545 | $this->_addHoliday($name, |
|---|
| 546 | $date, |
|---|
| 547 | 'Substitute Holiday for ' . |
|---|
| 548 | $this->_titles['C'][$internalName]); |
|---|
| 549 | } |
|---|
| 550 | } |
|---|
| 551 | } |
|---|
| 552 | |
|---|
| 553 | |
|---|
| 554 | |
|---|
| 555 | if (!is_null($this->_translationFile)) { |
|---|
| 556 | $this->addTranslationFile($this->_translationFile, $this->_translationLocale); |
|---|
| 557 | } |
|---|
| 558 | } |
|---|
| 559 | |
|---|
| 560 | |
|---|
| 561 | |
|---|
| 562 | |
|---|
| 563 | |
|---|
| 564 | |
|---|
| 565 | |
|---|
| 566 | |
|---|
| 567 | |
|---|
| 568 | |
|---|
| 569 | function _calcNthMondayInMonth($month, $position) |
|---|
| 570 | { |
|---|
| 571 | if ($position == 1) { |
|---|
| 572 | $startday = '01'; |
|---|
| 573 | } elseif ($position == 2) { |
|---|
| 574 | $startday = '08'; |
|---|
| 575 | } elseif ($position == 3) { |
|---|
| 576 | $startday = '15'; |
|---|
| 577 | } elseif ($position == 4) { |
|---|
| 578 | $startday = '22'; |
|---|
| 579 | } elseif ($position == 5) { |
|---|
| 580 | $startday = '29'; |
|---|
| 581 | } |
|---|
| 582 | $month = sprintf("%02d", $month); |
|---|
| 583 | |
|---|
| 584 | $date = new Date($this->_year . '-' . $month . '-' . $startday); |
|---|
| 585 | while ($date->getDayOfWeek() != 1) { |
|---|
| 586 | $date = $date->getNextDay(); |
|---|
| 587 | } |
|---|
| 588 | return $date; |
|---|
| 589 | } |
|---|
| 590 | |
|---|
| 591 | |
|---|
| 592 | |
|---|
| 593 | |
|---|
| 594 | |
|---|
| 595 | |
|---|
| 596 | |
|---|
| 597 | |
|---|
| 598 | |
|---|
| 599 | |
|---|
| 600 | |
|---|
| 601 | |
|---|
| 602 | |
|---|
| 603 | |
|---|
| 604 | |
|---|
| 605 | function addTranslationFile($file, $locale) |
|---|
| 606 | { |
|---|
| 607 | $result = parent::addTranslationFile($file, $locale); |
|---|
| 608 | if (PEAR::isError($result)) { |
|---|
| 609 | return $result; |
|---|
| 610 | } |
|---|
| 611 | $this->_translationFile = $file; |
|---|
| 612 | $this->_translationLocale = $locale; |
|---|
| 613 | return $result; |
|---|
| 614 | } |
|---|
| 615 | |
|---|
| 616 | |
|---|
| 617 | |
|---|
| 618 | |
|---|
| 619 | |
|---|
| 620 | |
|---|
| 621 | |
|---|
| 622 | |
|---|
| 623 | |
|---|
| 624 | |
|---|
| 625 | |
|---|
| 626 | |
|---|
| 627 | |
|---|
| 628 | |
|---|
| 629 | |
|---|
| 630 | function addCompiledTranslationFile($file, $locale) |
|---|
| 631 | { |
|---|
| 632 | $result = parent::addCompiledTranslationFile($file, $locale); |
|---|
| 633 | if (PEAR::isError($result)) { |
|---|
| 634 | return $result; |
|---|
| 635 | } |
|---|
| 636 | $this->_translationFile = $file; |
|---|
| 637 | $this->_translationLocale = $locale; |
|---|
| 638 | return $result; |
|---|
| 639 | } |
|---|
| 640 | |
|---|
| 641 | |
|---|
| 642 | |
|---|
| 643 | |
|---|
| 644 | |
|---|
| 645 | |
|---|
| 646 | |
|---|
| 647 | function _clearHolidays() |
|---|
| 648 | { |
|---|
| 649 | $this->_holidays = array(); |
|---|
| 650 | $this->_internalNames = array(); |
|---|
| 651 | $this->_dates = array(); |
|---|
| 652 | $this->_titles = array(); |
|---|
| 653 | } |
|---|
| 654 | } |
|---|
| 655 | ?> |
|---|