Sets the end date of an expirable.

@param AnDomainAttributeDate|AnDate|array $date The end date
170882
public function setEndDate($date)
    {
        $date = AnDomainAttributeDate::getInstance()->setDate($date);
        $this->set('endDate', $date);

        return $this;
    }
1264497
public function setEndDate($date, $inclusive = null)
    {
        if (!is_null($date) && !$date = call_user_func([$this->dateClass, 'make'], $date)) {
            throw new InvalidArgumentException('Invalid end date.');
        }

        if (!$date) {
            return $this->removeFilter(static::END_DATE_FILTER);
        }

        $this->endDate = $date;

        if ($inclusive !== null) {
            $this->toggleOptions(static::EXCLUDE_END_DATE, !$inclusive);
        }

        if (!$this->hasFilter(static::END_DATE_FILTER)) {
            return $this->addFilter(static::END_DATE_FILTER);
        }

        $this->handleChangedParameters();

        return $this;
    }
1147923
public static function freeze($date = null)
    {
        self::$freeze = false;
        self::$freezeDate = $date ? new DateTime($date) : self::now();
        self::$freeze = true;
    }
85687
public void setEndDate(com.google.api.ads.admanager.axis.v201902.Date endDate) {
        this.endDate = endDate;
    }
1093519
public function setDateFrom($date)
    {
        $date = static::instance($date);

        $this->setDate($date->year, $date->month, $date->day);

        return $this;
    }
1305835
public function setExpirationDate($expirationDate, $format = '')
    {
        try {
            if (is_string($expirationDate) && $format) {
                $date = \DateTime::createFromFormat($format, $expirationDate);
            } else if (is_string($expirationDate) && !$format) {
                $date = new \DateTime($expirationDate);
            } else {
                $date = $expirationDate;
            }
        } catch (\Exception $e) {
            throw new InvalidExpirationDateException($e->getMessage(), $e->getCode(), $e);
        }

        if (null !== $date && !($date instanceof \DateTime)) {
            throw new InvalidExpirationDateException();
        }

        $this->expirationDate = $date;

        return $this;
    }
310444
public void setDate(String date) {
        if (date == null || date.trim().isEmpty()) {
            throw new IllegalArgumentException("Date cannot be null or empty.");
        }
        try {
            Date dateToSet = new SimpleDateFormat("MM/dd/yyyy").parse(date);
            Calendar to = Calendar.getInstance();
            to.setTime(dateToSet);
            setDate(to);
        } catch (ParseException e) {
            throw new IllegalArgumentException(e);
        }
    }
547489
public function setExpiry(?\DateTimeImmutable $expiry = null): void
    {
        $date = new \DateTimeImmutable();
        $expiry = $expiry ?: $date;

        $this->setHeader('Date', $date->setTimezone(new \DateTimeZone('UTC'))->format('D, d M Y H:i:s \G\M\T'));
        $this->setHeader('Expires', $expiry->setTimezone(new \DateTimeZone('UTC'))->format('D, d M Y H:i:s \G\M\T'));

        if ($expiry <= $date) {
            $this->setHeader('Cache-Control', 'no-cache, no-store, must-revalidate, max-age=0');

            return;
        }

        $maxAge = $expiry->getTimestamp() - $date->getTimestamp();
        $this->setHeader('Cache-Control', 'public, max-age=' . $maxAge);
    }
395836
public function expired()
    {
        if (empty($this->expiresOn)) {
            return false;
        }

        return AnDomainAttributeDate::getInstance()->toDate()->compare($this->expiresOn) > 0;
    }
1093319
public function setExpireTime(\DateTime $date)
    {
        $date->setTimezone(new \DateTimeZone('UTC'));
        $this->_claims['exp'] = (int)$date->format('U');

        return $this;
    }
577864
public function setExpires($expires)
    {
        if ($expires !== null && !$expires instanceof \DateTime) {
            $expires = new \DateTime('@' . $expires);
        }
        $this->expires = $expires;

        return $this;
    }
980064
public function setDateEnd( $date )
	{
		if ( $date == $this->getDateEnd() ) { return; }

		$this->_checkDateFormat($date);

		$this->_values['end'] = ( $date !== null ? (string) $date : null );

		$this->setModified();
	}
370313
public function copy($date)
    {
        $this->year = $date->year;
        $this->month = $date->month;
        $this->day = $date->day;
        $this->hour = $date->hour;
        $this->minute = $date->minute;
        $this->second = $date->second;
    }
954771
public function setEndDate(Carbon $endDate)
    {
        $this->validatePeriod(null, $endDate);

        $this->endDate = $endDate;

        return $this;
    }
716112
public function setDateDelivery( $date )
	{
		if ( $date === $this->getDateDelivery() ) { return; }

		$this->_checkDateFormat($date);

		$this->_values['datedelivery'] = (string) $date;
		$this->setModified();
	}
561211
public final void setDate(final Date date) {
		this.date = (Date) date.clone();
		dateStr = ArchiveUtils.get14DigitDate(date);
	}
19342
public void setExpiry(Date expire) {
        addField(SubscribeOptionFields.expire, FormField.Type.text_single);
        setAnswer(SubscribeOptionFields.expire.getFieldName(), XmppDateTime.formatXEP0082Date(expire));
    }