* CalDAV/Calendar: fix weekly recurring events without explicit weekday (BYDAY) were not using start-date

This commit is contained in:
Ralf Becker 2021-03-02 15:26:55 +02:00
parent c742d0bafc
commit 18c550b692
2 changed files with 5 additions and 5 deletions

View File

@ -2707,7 +2707,7 @@ class calendar_ical extends calendar_boupdate
break;
case 'RRULE':
unset($vcardData['recur_type']); // it wont be set by +=
$vcardData += calendar_rrule::parseRrule($attributes['value']);
$vcardData += calendar_rrule::parseRrule($attributes['value'], false, $vcardData);
if (!empty($vcardData['recur_enddate'])) self::check_fix_endate ($vcardData);
break;
case 'EXDATE': // current Horde_Icalendar returns dates, no timestamps

View File

@ -982,13 +982,13 @@ class calendar_rrule implements Iterator
/**
* Parse an iCal recurrence-rule string
*
* @param type $recurence
* @param string $recurence
* @param bool $support_below_daily =false true: support FREQ=HOURLY|MINUTELY
* @return type
* @param array $vcardData =[] already parsed values, specially value for "start" is used if no explicit BYDAY attribute
* @return array
*/
public static function parseRrule($recurence, $support_below_daily=false)
public static function parseRrule($recurence, $support_below_daily=false, array $vcardData=[])
{
$vcardData = array();
$vcardData['recur_interval'] = 1;
$matches = null;
$type = preg_match('/FREQ=([^;: ]+)/i',$recurence,$matches) ? $matches[1] : $recurence[0];