diff --git a/inc/RRule.php b/inc/RRule.php index a58110d3..b3ef54b0 100644 --- a/inc/RRule.php +++ b/inc/RRule.php @@ -366,13 +366,14 @@ class RepeatRuleDateTime extends DateTime { if ( isset($matches[8]) && $matches[8] != '' ) $interval .= $minus . $matches[9] . ' minutes '; if (isset($matches[10]) &&$matches[10] != '' ) $interval .= $minus . $matches[11] . ' seconds '; } -// printf( "Modify '%s' by: >>%s<<\n", $this->__toString(), $interval ); + if ( DEBUG_RRULE) dbg_error_log( 'RRULE', "Modify '%s' by: >>%s<<\n", $this->__toString(), $interval ); // print_r($this); if ( !isset($interval) || $interval == '' ) $interval = '1 day'; if ( parent::format('d') > 28 && strstr($interval,'month') !== false ) { $this->setDate(null,null,28); } parent::modify($interval); + if (DEBUG_RRULE) dbg_error_log( 'RRULE', "Modified to '%s'", $this->__toString() ); return $this->__toString(); } @@ -837,6 +838,7 @@ class RepeatRule { $this->current_set = array( clone($this->current_base) ); foreach( self::rrule_expand_limit($this->freq) AS $bytype => $action ) { if ( isset($this->{$bytype}) ) { + if ( DEBUG_RRULE ) dbg_error_log( 'RRULE', "Going to find more instances by running %s_%s()", $action, $bytype ); $this->{$action.'_'.$bytype}(); if ( !isset($this->current_set[0]) ) break; } @@ -847,6 +849,7 @@ class RepeatRule { $position = count($this->instances) - 1; if ( DEBUG_RRULE ) dbg_error_log( 'RRULE', "Inserting %d from current_set into position %d", count($this->current_set), $position + 1 ); + foreach( $this->current_set AS $k => $instance ) { if ( $instance < $this->base ) continue; if ( isset($this->until) && $instance > $this->until ) {