mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-07 16:44:07 +01:00
Calculate the EGw recur_enddate properly
This commit is contained in:
parent
ed519fda33
commit
ac7424612e
@ -2072,16 +2072,6 @@ class calendar_ical extends calendar_boupdate
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($vcardData['recur_enddate']))
|
||||
{
|
||||
// reset recure_enddate to 00:00:00 on the last day
|
||||
$vcardData['recur_enddate'] = mktime(0, 0, 0,
|
||||
date('m', $vcardData['recur_enddate']),
|
||||
date('d', $vcardData['recur_enddate']),
|
||||
date('Y', $vcardData['recur_enddate'])
|
||||
);
|
||||
}
|
||||
|
||||
$event['priority'] = 2; // default
|
||||
$event['alarm'] = $alarms;
|
||||
|
||||
@ -2121,6 +2111,21 @@ class calendar_ical extends calendar_boupdate
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!empty($event['recur_enddate']))
|
||||
{
|
||||
// reset recure_enddate to 00:00:00 on the last day
|
||||
$rriter = calendar_rrule::event2rrule($event, false);
|
||||
$rriter->rewind();
|
||||
$last = clone $rriter->time;
|
||||
while ($rriter->current <= $rriter->enddate)
|
||||
{
|
||||
$last = clone $rriter->current;
|
||||
$rriter->next_no_exception();
|
||||
}
|
||||
$last->setTime(0, 0, 0);
|
||||
$event['recur_enddate'] = $this->date2ts($last);
|
||||
}
|
||||
|
||||
if ($this->calendarOwner) $event['owner'] = $this->calendarOwner;
|
||||
//Horde::logMessage("vevent2egw:\n" . print_r($event, true),
|
||||
// __FILE__, __LINE__, PEAR_LOG_DEBUG);
|
||||
|
Loading…
Reference in New Issue
Block a user