mirror of
https://gitlab.com/davical-project/davical.git
synced 2026-08-23 17:26:02 +00:00
RDATE/EXDATE can occur multiply, as well as contain multiple dates.
This commit is contained in:
parent
bfbe6a1e9a
commit
1f5818f624
@ -77,14 +77,17 @@ if ( class_exists('RepeatRule') ) {
|
||||
* @return array An array keyed on the UTC dates, referring to the component
|
||||
*/
|
||||
function rdate_expand( $dtstart, $property, $component, $range_end = null ) {
|
||||
$timezone = $component->GetPParamValue($property, 'TZID');
|
||||
$rdate = $component->GetPValue($property);
|
||||
$rdates = explode( ',', $rdate );
|
||||
$properties = $component->GetProperties($property);
|
||||
$expansion = array();
|
||||
foreach( $rdates AS $k => $v ) {
|
||||
$rdate = new RepeatRuleDateTime( $v, $timezone);
|
||||
$expansion[$rdate->UTC()] = $component;
|
||||
if ( $rdate > $range_end ) break;
|
||||
foreach( $properties AS $p ) {
|
||||
$timezone = $p->GetParameterValue('TZID');
|
||||
$rdate = $p->Value();
|
||||
$rdates = explode( ',', $rdate );
|
||||
foreach( $rdates AS $k => $v ) {
|
||||
$rdate = new RepeatRuleDateTime( $v, $timezone);
|
||||
$expansion[$rdate->UTC()] = $component;
|
||||
if ( $rdate > $range_end ) break;
|
||||
}
|
||||
}
|
||||
return $expansion;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user