src/ICal/ICal.php
protected function isExdateMatch($exdate, array $anEvent, $recurringOffset)
    {
        $searchDate = $anEvent['DTSTART'];

        if (substr($searchDate, -1) === 'Z') {
            $timeZone = self::TIME_ZONE_UTC;
        } else {
            if (isset($anEvent['DTSTART_array'][0]['TZID'])) {
                $checkTimeZone = $anEvent['DTSTART_array'][0]['TZID'];

                if ($this->isValidIanaTimeZoneId($checkTimeZone)) {
                    $timeZone = $checkTimeZone;
                } elseif ($this->isValidCldrTimeZoneId($checkTimeZone)) {
                    $timeZone = $this->isValidCldrTimeZoneId($checkTimeZone, true);
                } else {
                    $timeZone = $this->defaultTimeZone;
                }
            } else {
                $timeZone = $this->defaultTimeZone;
            }
        }

        $a = new Carbon($searchDate, $timeZone);
        $b = $exdate->addSeconds($recurringOffset);

        return $a->eq($b);
    }
protected function isExdateMatch($exdate, array $anEvent, $recurringOffset)
    {
        $searchDate = $anEvent['DTSTART'];

        if (substr($searchDate, -1) === 'Z') {
            $timeZone = self::TIME_ZONE_UTC;
        } else {
            if (isset($anEvent['DTSTART_array'][0]['TZID'])) {
                $checkTimeZone = $anEvent['DTSTART_array'][0]['TZID'];

                if ($this->isValidIanaTimeZoneId($checkTimeZone)) {
                    $timeZone = $checkTimeZone;
                } elseif ($this->isValidCldrTimeZoneId($checkTimeZone)) {
                    $timeZone = $this->isValidCldrTimeZoneId($checkTimeZone, true);
                } else {
                    $timeZone = $this->defaultTimeZone;
                }
            } else {
                $timeZone = $this->defaultTimeZone;
            }
        }

        $a = new Carbon($searchDate, $timeZone);
        $b = $exdate->addSeconds($recurringOffset);

        return $a->eq($b);
    }
protected function isExdateMatch ( $ exdate , array $ anEvent , $ recurringOffset ) { $ searchDate = $ anEvent [ 'DTSTART' ] ; if ( substr ( $ searchDate , - 1 ) === 'Z' ) { $ timeZone = self :: TIME_ZONE_UTC ; } else { if ( isset ( $ anEvent [ 'DTSTART_array' ] [ 0 ] [ 'TZID' ] ) ) { $ checkTimeZone = $ anEvent [ 'DTSTART_array' ] [ 0 ] [ 'TZID' ] ; if ( $ this -> isValidIanaTimeZoneId ( $ checkTimeZone ) ) { $ timeZone = $ checkTimeZone ; } elseif ( $ this -> isValidCldrTimeZoneId ( $ checkTimeZone ) ) { $ timeZone = $ this -> isValidCldrTimeZoneId ( $ checkTimeZone , true ) ; } else { $ timeZone = $ this -> defaultTimeZone ; } } else { $ timeZone = $ this -> defaultTimeZone ; } } $ a = new Carbon ( $ searchDate , $ timeZone ) ; $ b = $ exdate -> addSeconds ( $ recurringOffset ) ; return $ a -> eq ( $ b ) ; }
Checks if an excluded date matches a given date by reconciling time zones.

@param  Carbon  $exdate
@param  array   $anEvent
@param  integer $recurringOffset
@return boolean
Checks if an excluded date matches a given date by reconciling time zones .