From: <ral...@us...> - 2015-06-25 20:31:00
|
Author: ralfbecker Date: Thu Jun 25 22:30:52 2015 New Revision: 52997 URL: http://svn.stylite.de/viewvc/egroupware?rev=52997&view=rev Log: * Calendar/iCal/CalDAV: recuring events were exported to long our enddate is the end-time, not start-time of last event! Modified: trunk/calendar/ (props changed) trunk/calendar/inc/class.calendar_rrule.inc.php Propchange: trunk/calendar/ ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Thu Jun 25 22:30:52 2015 @@ -1,2 +1,2 @@ -/branches/14.2/calendar:52649,52963,52967,52969 +/branches/14.2/calendar:52649,52963,52967,52969,52996 /branches/Stylite-EPL-11.1/calendar:51445 Modified: trunk/calendar/inc/class.calendar_rrule.inc.php URL: http://svn.stylite.de/viewvc/egroupware/trunk/calendar/inc/class.calendar_rrule.inc.php?rev=52997&r1=52996&r2=52997&view=diff ============================================================================== --- trunk/calendar/inc/class.calendar_rrule.inc.php (original) +++ trunk/calendar/inc/class.calendar_rrule.inc.php Thu Jun 25 22:30:52 2015 @@ -6,7 +6,7 @@ * @package calendar * @author Ralf Becker <RalfBecker-AT-outdoor-training.de> * @author Joerg Lehrke <jl...@no...> - * @copyright (c) 2009 by RalfBecker-At-outdoor-training.de + * @copyright (c) 2009-15 by RalfBecker-At-outdoor-training.de * @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License * @version $Id$ */ @@ -182,14 +182,14 @@ /** * Starttime of series * - * @var DateTime + * @var egw_time */ public $time; /** * Current "position" / time * - * @var DateTime + * @var egw_time */ public $current; @@ -234,7 +234,7 @@ $this->lastdayofweek = self::SUNDAY; } - $this->time = $time; + $this->time = $time instanceof egw_time ? $time : new egw_time($time); if (!in_array($type,array(self::NONE, self::DAILY, self::WEEKLY, self::MONTHLY_MDAY, self::MONTHLY_WDAY, self::YEARLY))) { @@ -697,7 +697,16 @@ if ($this->enddate) { - $rrule['UNTIL'] = $this->enddate; + // our enddate is the end-time, not start-time of last event! + $this->rewind(); + $enddate = $this->current(); + do + { + $this->next_no_exception(); + $occurrence = $this->current(); + } + while ($this->valid() && ($enddate = $occurrence)); + $rrule['UNTIL'] = $enddate; } return $rrule; |