Lines Matching refs:offsets

98      * @param array $offsets  A TZ offset hash
103 public static function getSyncTZFromOffsets(array $offsets) argument
106 $offsets['bias'] = Horde_Mapi::chbo($offsets['bias']);
107 $offsets['stdbias'] = Horde_Mapi::chbo($offsets['stdbias']);
108 $offsets['dstbias'] = Horde_Mapi::chbo($offsets['dstbias']);
112offsets['bias'], '', 0, $offsets['stdmonth'], $offsets['stdday'], $offsets['stdweek'], $offsets['s…
113offsets['stdbias'], '', 0, $offsets['dstmonth'], $offsets['dstday'], $offsets['dstweek'], $offsets
114 $offsets['dstbias']);
129 $offsets = array(
160 $offsets['bias'] = $std['offset'] / 60 * -1;
162 $offsets = self::_generateOffsetsForTransition($offsets, $std, 'std');
163 $offsets = self::_generateOffsetsForTransition($offsets, $dst, 'dst');
164 $offsets['stdhour'] += $dst['offset'] / 3600;
165 $offsets['dsthour'] += $std['offset'] / 3600;
166 $offsets['dstbias'] = ($dst['offset'] - $std['offset']) / 60 * -1;
170 return $offsets;
223 * @param array $offsets A TZ offset hash
229 … protected static function _generateOffsetsForTransition(array $offsets, array $transition, $type) argument
238 $offsets[$type . 'month'] = $transitionDate->format('n');
239 $offsets[$type . 'day'] = $transitionDate->format('w');
240 $offsets[$type . 'minute'] = (int)$transitionDate->format('i');
241 $offsets[$type . 'hour'] = (int)$transitionDate->format('H');
244 $offsets[$type . 'week'] = $i;
249 return $offsets;
263 * @param array|string $offsets The timezone to check. Either an array
270 public function getTimezone($offsets, $expectedTimezone = null) argument
272 $timezones = $this->getListOfTimezones($offsets, $expectedTimezone);
284 * @param array|string $offsets Either an offset array, or a AS timezone
290 public function getListOfTimezones($offsets, $expectedTimezone = null) argument
292 if (is_string($offsets)) {
293 $offsets = self::getOffsetsFromSyncTZ($offsets);
295 $this->_setDefaultStartDate($offsets);
299 if (false !== ($matchingTransition = $this->_checkTimezone($timezone, $offsets))) {
322 * @param array $offsets Offsets may be avaluated for a given start year
324 protected function _setDefaultStartDate(array $offsets = null) argument
330 if (!empty($offsets['stdyear'])) {
331 $this->_startDate = new Horde_Date($offsets['stdyear'] . '-01-01');
344 * @param array $offsets The offsets to check.
349 protected function _checkTimezone(DateTimeZone $timezone, array $offsets) argument
352 if ($this->_checkTransition($std, $dst, $offsets)) {
365 * @param array $offsets The offsets to check.
369 protected function _checkTransition(array $std, array $dst, array $offsets) argument
371 if (empty($std) || empty($offsets)) {
375 $standardOffset = ($offsets['bias'] + $offsets['stdbias']) * 60 * -1;
380 if ((empty($offsets['dstmonth']) && (empty($dst) || empty($dst['isdst']))) ||
381 (empty($dst) && !empty($offsets['dstmonth']))) {
385 $daylightOffset = ($offsets['bias'] + $offsets['dstbias']) * 60 * -1;
387 … $daylightOffsetMilestone = ($offsets['dstbias'] + ($offsets['dstbias'] * -1) ) * 60 * -1;
393 if ($standardParsed->format('n') == $offsets['stdmonth'] &&
394 $daylightParsed->format('n') == $offsets['dstmonth'] &&
395 $standardParsed->format('w') == $offsets['stdday'] &&
396 $daylightParsed->format('w') == $offsets['dstday'])
398 return self::_isNthOcurrenceOfWeekdayInMonth($dst['ts'], $offsets['dstweek']) &&
399 self::_isNthOcurrenceOfWeekdayInMonth($std['ts'], $offsets['stdweek']);