Horde_Date_Recurrence::nextActiveRecurrence PHP Method

nextActiveRecurrence() public method

Returns the next active recurrence.
public nextActiveRecurrence ( Horde_Date $afterDate ) : Horde_Date | boolean
$afterDate Horde_Date Return events after this date.
return Horde_Date | boolean The date of the next active recurrence or false if the event has no active recurrence after $afterDate.
    public function nextActiveRecurrence($afterDate)
    {
        $next = $this->nextRecurrence($afterDate);
        while (is_object($next)) {
            if (!$this->hasException($next->year, $next->month, $next->mday) && !$this->hasCompletion($next->year, $next->month, $next->mday)) {
                return $next;
            }
            $next->mday++;
            $next = $this->nextRecurrence($next);
        }
        return false;
    }

Usage Example

Exemplo n.º 1
0
 /**
  * Returns the next due date of this task.
  *
  * Takes recurring tasks into account.
  *
  * @return Horde_Date  The next due date.
  */
 public function getNextDue()
 {
     if (!$this->due) {
         return null;
     }
     if (!$this->recurs()) {
         return new Horde_Date($this->due);
     }
     return $this->recurrence->nextActiveRecurrence($this->due);
 }
All Usage Examples Of Horde_Date_Recurrence::nextActiveRecurrence