Changeset 1210
- Timestamp:
- 11/02/06 01:19:52 (2 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/config/AgaviTimeZoneDataParser.class.php
r1209 r1210 325 325 $myRules[] = array('time' => $lastRuleEndTime, 'rawOffset' => $gmtOff, 'dstOffset' => $dstOff, 'name' => $format); 326 326 } else { 327 // TODO: !!327 // TODO: we probably don't need to add the first rule at all, check this! 328 328 } 329 329 … … 332 332 333 333 if($lastZoneRule) { 334 if(count($myRules) == 0) { 335 // this should actually never happen! 336 $lastRuleStartYear = self::MIN_YEAR_VALUE; 337 } else { 338 $cal = $this->getContext()->getTranslationManager()->createCalendar(); 339 $cal->setTime($myRules[count($myRules) - 1]['time'] * AgaviDateDefinitions::MILLIS_PER_SECOND); 340 // + 1 because this specifies the first year in which the final rule will apply 341 $lastRuleStartYear = $cal->get(AgaviDateDefinitions::YEAR) + 1; 342 } 343 334 344 if($activeSubRules !== null) { 335 345 $cnt = count($activeSubRules); … … 338 348 } 339 349 if($cnt == 0) { 340 $finalRule = array('type' => 'none', 'offset' => $gmtOff );350 $finalRule = array('type' => 'none', 'offset' => $gmtOff, 'startYear' => $lastRuleStartYear); 341 351 } else { 342 352 // normalize the keys … … 369 379 'type' => AgaviSimpleTimeZone::WALL_TIME, 370 380 ), 381 'startYear' => $lastRuleStartYear, 371 382 ); 372 383 … … 401 412 } 402 413 } else { 403 $finalRule = array('type' => 'static', 'name' => $format, 'offset' => $gmtOff );414 $finalRule = array('type' => 'static', 'name' => $format, 'offset' => $gmtOff, 'startYear' => $lastRuleStartYear); 404 415 } 405 416 }

