classes/Events/API/Event.php
public function getLastOccurrence($before_timestamp = null) {
		if ($before_timestamp === null) {
			$before_timestamp = time();
		}
		
		$before_timestamp = (int) $before_timestamp;
		
		$prev = false;
		if ($this->isRecurring()) {
			$starttimes = $this->getStartTimes($this->getStartTimestamp(), $before_timestamp);
			
			if ($starttimes) {
				$prev = end($starttimes);
			}
		}
		else {
			$prev = $this->getStartTimestamp();
			
			if ($prev > $before_timestamp) {
				$prev = false; // there is no occurrence before the timestamp
			}
		}
		
		return $prev;
	}
public function getLastOccurrence($before_timestamp = null) {
		if ($before_timestamp === null) {
			$before_timestamp = time();
		}
		
		$before_timestamp = (int) $before_timestamp;
		
		$prev = false;
		if ($this->isRecurring()) {
			$starttimes = $this->getStartTimes($this->getStartTimestamp(), $before_timestamp);
			
			if ($starttimes) {
				$prev = end($starttimes);
			}
		}
		else {
			$prev = $this->getStartTimestamp();
			
			if ($prev > $before_timestamp) {
				$prev = false; // there is no occurrence before the timestamp
			}
		}
		
		return $prev;
	}
public function getLastOccurrence ( $ before_timestamp = null ) { if ( $ before_timestamp === null ) { $ before_timestamp = time ( ) ; } $ before_timestamp = ( int ) $ before_timestamp ; $ prev = false ; if ( $ this -> isRecurring ( ) ) { $ starttimes = $ this -> getStartTimes ( $ this -> getStartTimestamp ( ) , $ before_timestamp ) ; if ( $ starttimes ) { $ prev = end ( $ starttimes ) ; } } else { $ prev = $ this -> getStartTimestamp ( ) ; if ( $ prev > $ before_timestamp ) { $ prev = false ; // there is no occurrence before the timestamp } } return $ prev ; }
Returns the timestamp of the previous event occurence
Returns false if there are no past occurrences

@param int $before_timestamp Find previous occurrence
@return int|false
Returns the timestamp of the previous event occurence Returns false if there are no past occurrences