classes/Events/API/Event.php
public function calculateRepeatEndTimestamp() {

		// determine when it actually stops repeating in terms of timestamp
		switch ($this->repeat_end_type) {

			case Util::REPEAT_END_ON:
				$repeat_end_timestamp = strtotime($this->repeat_end_on);
				if ($repeat_end_timestamp === false) {
					$repeat_end_timestamp = 0; //@TODO - what else could we do here?
				}
				$return = $repeat_end_timestamp;
				break;
			case Util::REPEAT_END_AFTER:
				$return = $this->calculateEndAfterTimestamp($this->repeat_end_after);
				break;
			case Util::REPEAT_END_NEVER :
				$return = 0;
				break;
			default :
				if ($this->repeat) {
					$return = 0;
				}
				else {
					$return = $this->getStartTimestamp();
				}
			break;
		}
		
		if ($return && $return < $this->getEndTimestamp()) {
			$return = $this->getEndTimestamp();
		}
		
		return $return;
	}
public function calculateRepeatEndTimestamp() {

		// determine when it actually stops repeating in terms of timestamp
		switch ($this->repeat_end_type) {

			case Util::REPEAT_END_ON:
				$repeat_end_timestamp = strtotime($this->repeat_end_on);
				if ($repeat_end_timestamp === false) {
					$repeat_end_timestamp = 0; //@TODO - what else could we do here?
				}
				$return = $repeat_end_timestamp;
				break;
			case Util::REPEAT_END_AFTER:
				$return = $this->calculateEndAfterTimestamp($this->repeat_end_after);
				break;
			case Util::REPEAT_END_NEVER :
				$return = 0;
				break;
			default :
				if ($this->repeat) {
					$return = 0;
				}
				else {
					$return = $this->getStartTimestamp();
				}
			break;
		}
		
		if ($return && $return < $this->getEndTimestamp()) {
			$return = $this->getEndTimestamp();
		}
		
		return $return;
	}
public function calculateRepeatEndTimestamp ( ) { // determine when it actually stops repeating in terms of timestamp switch ( $ this -> repeat_end_type ) { case Util :: REPEAT_END_ON : $ repeat_end_timestamp = strtotime ( $ this -> repeat_end_on ) ; if ( $ repeat_end_timestamp === false ) { $ repeat_end_timestamp = 0 ; //@TODO - what else could we do here? } $ return = $ repeat_end_timestamp ; break ; case Util :: REPEAT_END_AFTER : $ return = $ this -> calculateEndAfterTimestamp ( $ this -> repeat_end_after ) ; break ; case Util :: REPEAT_END_NEVER : $ return = 0 ; break ; default : if ( $ this -> repeat ) { $ return = 0 ; } else { $ return = $ this -> getStartTimestamp ( ) ; } break ; } if ( $ return && $ return < $ this -> getEndTimestamp ( ) ) { $ return = $ this -> getEndTimestamp ( ) ; } return $ return ; }
Calculates and returns the last timestamp for event recurrences
@return int
Calculates and returns the last timestamp for event recurrences