public function buildEventDates(array $data)
    {
        $dates = [];
        $eventLength = $this->calculateEventLength($data);
        $allDay = array_key_exists('all_day', $data);

        foreach ($data['repeat_dates'] as $date) {
            if (strlen($date) > 0) {
                $date = strtotime($date . ' ' . $data['start']['time']);

                if (false === $date) {
                    throw new InvalidDateStringException('Invalid date string!');
                }

                $eventStart = $this->carbon->copy()->setTimestamp($date);
                $eventEnds = $allDay ? null : $eventStart->copy()->addSeconds($eventLength);
                $dates[] = [
                    'start' => $eventStart->toDateTimeString(),
                    'end' => (null !== $eventEnds) ? $eventEnds->toDateTimeString() : null,
                ];
            }
        }

        return $dates;
    }