public function setEnd($end, $write=true)
    {
        $e = $this;

        if ($e->TimeFrameType == 'DateTime') {
            $e->EndDateTime = $end;
        } elseif ($e->TimeFrameType == 'Duration') {
            $duration = $this->calcDurationBasedOnEndDateTime($end);
            if ($duration) {
                $e->Duration = $duration;
            } else {
                //if duration is more than 1 day, make the time frame "DateTime"
                $e->TimeFrameType = 'DateTime';
                $e->EndDateTime = $end;
            }
        }

        if ($write) {
            $e->write();
        }
    }
public function setEnd($end, $write=true)
    {
        $e = $this;

        if ($e->TimeFrameType == 'DateTime') {
            $e->EndDateTime = $end;
        } elseif ($e->TimeFrameType == 'Duration') {
            $duration = $this->calcDurationBasedOnEndDateTime($end);
            if ($duration) {
                $e->Duration = $duration;
            } else {
                //if duration is more than 1 day, make the time frame "DateTime"
                $e->TimeFrameType = 'DateTime';
                $e->EndDateTime = $end;
            }
        }

        if ($write) {
            $e->write();
        }
    }
public function setEnd ( $ end , $ write = true ) { $ e = $ this ; if ( $ e -> TimeFrameType == 'DateTime' ) { $ e -> EndDateTime = $ end ; } elseif ( $ e -> TimeFrameType == 'Duration' ) { $ duration = $ this -> calcDurationBasedOnEndDateTime ( $ end ) ; if ( $ duration ) { $ e -> Duration = $ duration ; } else { //if duration is more than 1 day, make the time frame "DateTime" $ e -> TimeFrameType = 'DateTime' ; $ e -> EndDateTime = $ end ; } } if ( $ write ) { $ e -> write ( ) ; } }
Set new end date
@param string $end Should be SS_Datetime compatible
@param boolean $write If true, write to the db
Set new end date