Skip to content

Commit

Permalink
Revert "Bug: 14453 Limit addCoverDates to the $endDate."
Browse files Browse the repository at this point in the history
This reverts commit 81d5379.
  • Loading branch information
mrubinsk committed Aug 26, 2016
1 parent c969c7f commit 31e2465
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions kronolith/lib/Kronolith.php
Expand Up @@ -364,7 +364,7 @@ static public function addEvents(&$results, &$event, $startDate, $endDate,
$event->start->month,
$event->start->mday)) {
if ($coverDates) {
self::addCoverDates($results, $event, $event->start, $event->end, $json, $endDate);
self::addCoverDates($results, $event, $event->start, $event->end, $json);
} else {
$results[$event->start->dateString()][$event->id] = $json ? $event->toJson() : $event;
}
Expand Down Expand Up @@ -406,7 +406,7 @@ static public function addEvents(&$results, &$event, $startDate, $endDate,
$addEvent->start = $addEvent->originalStart = $next;
$addEvent->end = $addEvent->originalEnd = $nextEnd;
if ($coverDates) {
self::addCoverDates($results, $addEvent, $next, $nextEnd, $json, $endDate);
self::addCoverDates($results, $addEvent, $next, $nextEnd, $json);
} else {
$addEvent->start = $next;
$addEvent->end = $nextEnd;
Expand Down Expand Up @@ -519,8 +519,7 @@ static public function addEvents(&$results, &$event, $startDate, $endDate,
$loopDate = new Horde_Date(array('month' => $eventStart->month,
'mday' => $i,
'year' => $eventStart->year));
while ($loopDate->compareDateTime($eventEnd) <= 0 &&
$loopDate->compareDateTime($endDate) <=0) {
while ($loopDate->compareDateTime($eventEnd) <= 0) {
if (!$allDay ||
$loopDate->compareDateTime($eventEnd) != 0) {
$addEvent = clone $event;
Expand Down Expand Up @@ -572,16 +571,13 @@ static public function addEvents(&$results, &$event, $startDate, $endDate,
* @param Horde_Date $eventEnd The event's end at the actual recurrence.
* @param boolean $json Store the results of the events' toJson()
* method?
* @param Horde_Date $endDate The ending date of the current view.
*/
static public function addCoverDates(&$results, $event, $eventStart,
$eventEnd, $json, Horde_Date $endDate = null)
$eventEnd, $json)
{
$loopDate = new Horde_Date($eventStart->year, $eventStart->month, $eventStart->mday);
$allDay = $event->isAllDay();
$endDate = empty($endDate) ? $eventEnd : $endDate;
while ($loopDate->compareDateTime($eventEnd) <= 0 &&
$loopDate->compareDateTime($endDate) <= 0) {
while ($loopDate->compareDateTime($eventEnd) <= 0) {
if (!$allDay ||
$loopDate->compareDateTime($eventEnd) != 0) {
$addEvent = clone $event;
Expand Down

0 comments on commit 31e2465

Please sign in to comment.