src/Engine/CalendarEventsEngine.php
protected function calculateEventLength(array $data)
    {
        $start = $this->carbon->copy()->setTimestamp(strtotime($data['start']['date'] . ' ' . $data['start']['time']));

        if (array_key_exists('all_day', $data)) {
            $end = $this->carbon->copy()->setTimestamp(strtotime($data['start']['date'] . ' 23:59:59'));
        } else {
            $end = $this->carbon->copy()->setTimestamp(strtotime($data['start']['date'] . ' ' . $data['end']['time']));
        }

        return $start->diffInSeconds($end);
    }
protected function calculateEventLength(array $data)
    {
        $start = $this->carbon->copy()->setTimestamp(strtotime($data['start']['date'] . ' ' . $data['start']['time']));

        if (array_key_exists('all_day', $data)) {
            $end = $this->carbon->copy()->setTimestamp(strtotime($data['start']['date'] . ' 23:59:59'));
        } else {
            $end = $this->carbon->copy()->setTimestamp(strtotime($data['start']['date'] . ' ' . $data['end']['time']));
        }

        return $start->diffInSeconds($end);
    }
protected function calculateEventLength ( array $ data ) { $ start = $ this -> carbon -> copy ( ) -> setTimestamp ( strtotime ( $ data [ 'start' ] [ 'date' ] . ' ' . $ data [ 'start' ] [ 'time' ] ) ) ; if ( array_key_exists ( 'all_day' , $ data ) ) { $ end = $ this -> carbon -> copy ( ) -> setTimestamp ( strtotime ( $ data [ 'start' ] [ 'date' ] . ' 23:59:59' ) ) ; } else { $ end = $ this -> carbon -> copy ( ) -> setTimestamp ( strtotime ( $ data [ 'start' ] [ 'date' ] . ' ' . $ data [ 'end' ] [ 'time' ] ) ) ; } return $ start -> diffInSeconds ( $ end ) ; }
Calculate event length in seconds

@param array $data

@return int
Calculate event length in seconds