src/ICal/ICal.php
protected function processDateConversions()
    {
        $events = (isset($this->cal['VEVENT'])) ? $this->cal['VEVENT'] : array();

        if (!empty($events)) {
            foreach ($events as $key => $anEvent) {
                if (!$this->isValidDate($anEvent['DTSTART'])) {
                    unset($events[$key]);
                    $this->eventCount--;

                    continue;
                }

                if ($this->useTimeZoneWithRRules && isset($anEvent['RRULE_array'][2]) && $anEvent['RRULE_array'][2] === self::RECURRENCE_EVENT) {
                    $events[$key]['DTSTART_tz'] = $anEvent['DTSTART'];
                    $events[$key]['DTEND_tz']   = isset($anEvent['DTEND']) ? $anEvent['DTEND'] : $anEvent['DTSTART'];
                } else {
                    $events[$key]['DTSTART_tz'] = $this->iCalDateWithTimeZone($anEvent, 'DTSTART');

                    if ($this->iCalDateWithTimeZone($anEvent, 'DTEND')) {
                        $events[$key]['DTEND_tz'] = $this->iCalDateWithTimeZone($anEvent, 'DTEND');
                    } elseif ($this->iCalDateWithTimeZone($anEvent, 'DURATION')) {
                        $events[$key]['DTEND_tz'] = $this->iCalDateWithTimeZone($anEvent, 'DURATION');
                    } elseif ($this->iCalDateWithTimeZone($anEvent, 'DTSTART')) {
                        $events[$key]['DTEND_tz'] = $this->iCalDateWithTimeZone($anEvent, 'DTSTART');
                    }
                }
            }

            $this->cal['VEVENT'] = $events;
        }
    }
protected function processDateConversions()
    {
        $events = (isset($this->cal['VEVENT'])) ? $this->cal['VEVENT'] : array();

        if (!empty($events)) {
            foreach ($events as $key => $anEvent) {
                if (!$this->isValidDate($anEvent['DTSTART'])) {
                    unset($events[$key]);
                    $this->eventCount--;

                    continue;
                }

                if ($this->useTimeZoneWithRRules && isset($anEvent['RRULE_array'][2]) && $anEvent['RRULE_array'][2] === self::RECURRENCE_EVENT) {
                    $events[$key]['DTSTART_tz'] = $anEvent['DTSTART'];
                    $events[$key]['DTEND_tz']   = isset($anEvent['DTEND']) ? $anEvent['DTEND'] : $anEvent['DTSTART'];
                } else {
                    $events[$key]['DTSTART_tz'] = $this->iCalDateWithTimeZone($anEvent, 'DTSTART');

                    if ($this->iCalDateWithTimeZone($anEvent, 'DTEND')) {
                        $events[$key]['DTEND_tz'] = $this->iCalDateWithTimeZone($anEvent, 'DTEND');
                    } elseif ($this->iCalDateWithTimeZone($anEvent, 'DURATION')) {
                        $events[$key]['DTEND_tz'] = $this->iCalDateWithTimeZone($anEvent, 'DURATION');
                    } elseif ($this->iCalDateWithTimeZone($anEvent, 'DTSTART')) {
                        $events[$key]['DTEND_tz'] = $this->iCalDateWithTimeZone($anEvent, 'DTSTART');
                    }
                }
            }

            $this->cal['VEVENT'] = $events;
        }
    }
protected function processDateConversions ( ) { $ events = ( isset ( $ this -> cal [ 'VEVENT' ] ) ) ? $ this -> cal [ 'VEVENT' ] : array ( ) ; if ( ! empty ( $ events ) ) { foreach ( $ events as $ key => $ anEvent ) { if ( ! $ this -> isValidDate ( $ anEvent [ 'DTSTART' ] ) ) { unset ( $ events [ $ key ] ) ; $ this -> eventCount -- ; continue ; } if ( $ this -> useTimeZoneWithRRules && isset ( $ anEvent [ 'RRULE_array' ] [ 2 ] ) && $ anEvent [ 'RRULE_array' ] [ 2 ] === self :: RECURRENCE_EVENT ) { $ events [ $ key ] [ 'DTSTART_tz' ] = $ anEvent [ 'DTSTART' ] ; $ events [ $ key ] [ 'DTEND_tz' ] = isset ( $ anEvent [ 'DTEND' ] ) ? $ anEvent [ 'DTEND' ] : $ anEvent [ 'DTSTART' ] ; } else { $ events [ $ key ] [ 'DTSTART_tz' ] = $ this -> iCalDateWithTimeZone ( $ anEvent , 'DTSTART' ) ; if ( $ this -> iCalDateWithTimeZone ( $ anEvent , 'DTEND' ) ) { $ events [ $ key ] [ 'DTEND_tz' ] = $ this -> iCalDateWithTimeZone ( $ anEvent , 'DTEND' ) ; } elseif ( $ this -> iCalDateWithTimeZone ( $ anEvent , 'DURATION' ) ) { $ events [ $ key ] [ 'DTEND_tz' ] = $ this -> iCalDateWithTimeZone ( $ anEvent , 'DURATION' ) ; } elseif ( $ this -> iCalDateWithTimeZone ( $ anEvent , 'DTSTART' ) ) { $ events [ $ key ] [ 'DTEND_tz' ] = $ this -> iCalDateWithTimeZone ( $ anEvent , 'DTSTART' ) ; } } } $ this -> cal [ 'VEVENT' ] = $ events ; } }
Processes date conversions using the time zone

Add keys `DTSTART_tz` and `DTEND_tz` to each Event
These keys contain dates adapted to the calendar
time zone depending on the event `TZID`.

@return void
Processes date conversions using the time zone