Calendar: fix bug in creating DTEND from DTSTART

This commit is contained in:
Bart Visscher 2012-03-01 20:50:00 +01:00
parent 642ccd27ab
commit fe3bcb5fe2
2 changed files with 4 additions and 2 deletions

View File

@ -44,8 +44,8 @@ foreach($events as $event){
$return_event = create_return_event($event, $vevent);
$dtstart = $vevent->DTSTART;
$dtend = OC_Calendar_Object::getDTEndFromVEvent($vevent);
$start_dt = $dtstart->getDateTime();
$dtend = OC_Calendar_Object::getDTEndFromVEvent($vevent);
$end_dt = $dtend->getDateTime();
if ($dtstart->getDateType() == Sabre_VObject_Element_DateTime::DATE){
$return_event['allDay'] = true;

View File

@ -309,6 +309,8 @@ class OC_Calendar_Object{
$dtend = $vevent->DTEND;
}else{
$dtend = clone $vevent->DTSTART;
// clone creates a shallow copy, also clone DateTime
$dtend->setDateTime(clone $dtend->getDateTime(), $dtend->getDateType());
if ($vevent->DURATION){
$duration = strval($vevent->DURATION);
$invert = 0;
@ -817,4 +819,4 @@ class OC_Calendar_Object{
return $vcalendar;
}
}
}