Model/DateTimeRange.php
public function setMax($max)
    {
        if ($max instanceof DateTime) {
            $this->max = $max;
        } else {
            try {
                $this->max = new DateTime($max);
            } catch (\Exception $e) {
                $this->max = null;
            }
        }

        return $this;
    }
public function setMax($max)
    {
        if ($max instanceof DateTime) {
            $this->max = $max;
        } else {
            try {
                $this->max = new DateTime($max);
            } catch (\Exception $e) {
                $this->max = null;
            }
        }

        return $this;
    }
Sets the "max" of the DateTimeRange.

@param DateTime $max

@return DateTimeRange