mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-23 08:23:12 +01:00
* CalDAV: fix recurring event one day short, if number of recurence specified together with event-length, after rrule in iCal
This commit is contained in:
parent
e49158d7c1
commit
a3549df5e2
@ -2287,8 +2287,11 @@ class calendar_ical extends calendar_boupdate
|
||||
'recur_type' => MCAL_RECUR_NONE,
|
||||
'recur_exception' => array(),
|
||||
);
|
||||
// we parse DTSTART and DTEND first
|
||||
foreach ($component->_attributes as $attributes)
|
||||
// we need to parse DTSTART, DTEND or DURATION (in that order!) first
|
||||
foreach (array_merge(
|
||||
$component->getAllAttributes('DTSTART'),
|
||||
$component->getAllAttributes('DTEND'),
|
||||
$component->getAllAttributes('DURATION')) as $attributes)
|
||||
{
|
||||
switch ($attributes['name'])
|
||||
{
|
||||
@ -2348,6 +2351,18 @@ class calendar_ical extends calendar_boupdate
|
||||
$dtend_ts -= 1;
|
||||
}
|
||||
$vcardData['end'] = $dtend_ts;
|
||||
break;
|
||||
|
||||
case 'DURATION': // clients can use DTSTART+DURATION, instead of DTSTART+DTEND
|
||||
if (!isset($vcardData['end']))
|
||||
{
|
||||
$vcardData['end'] = $vcardData['start'] + $attributes['value'];
|
||||
}
|
||||
else
|
||||
{
|
||||
error_log(__METHOD__."() find DTEND AND DURATION --> ignoring DURATION");
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!isset($vcardData['start']))
|
||||
@ -2364,16 +2379,6 @@ class calendar_ical extends calendar_boupdate
|
||||
{
|
||||
switch ($attributes['name'])
|
||||
{
|
||||
case 'DURATION': // clients can use DTSTART+DURATION, instead of DTSTART+DTEND
|
||||
if (!isset($vcardData['end']))
|
||||
{
|
||||
$vcardData['end'] = $vcardData['start'] + $attributes['value'];
|
||||
}
|
||||
else
|
||||
{
|
||||
error_log(__METHOD__."() find DTEND AND DURATION --> ignoring DURATION");
|
||||
}
|
||||
break;
|
||||
case 'X-MICROSOFT-CDO-ALLDAYEVENT':
|
||||
$event['whole_day'] = (isset($attributes['value'])?strtoupper($attributes['value'])=='TRUE':true);
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user