Only set an enddate if one is available

This commit is contained in:
Tim Schumacher 2014-07-29 15:31:05 +02:00
parent 60090ad619
commit 0691e1e537
2 changed files with 4 additions and 2 deletions

View file

@ -79,7 +79,8 @@ class LocationController extends Controller
/** @var Event $entity */
$event = new CalendarEvent();
$event->setStart($entity->startdate);
$event->setEnd($entity->enddate);
if ($entity->enddate instanceof \DateTime)
$event->setEnd($entity->enddate);
$event->setSummary($entity->summary);
$event->setDescription($entity->description);
$location = new \Jsvrcek\ICS\Model\Description\Location();

View file

@ -75,7 +75,8 @@ class TagController extends Controller
/** @var Event $entity */
$event = new CalendarEvent();
$event->setStart($entity->startdate);
$event->setEnd($entity->enddate);
if ($entity->enddate instanceof \DateTime)
$event->setEnd($entity->enddate);
$event->setSummary($entity->summary);
$event->setDescription($entity->description);
$location = new \Jsvrcek\ICS\Model\Description\Location();