Returns whether the target date column is date only.

@return bool     defaults to false if unknown.
502852
protected function isTargetDateOnly()
    {
        if ( ! $this->filterData) {
            return false;
        }

        $target = $this->filterData->target();

        if ( ! array_key_exists($target, $this->getModelInformation()->attributes)) {
            // @codeCoverageIgnoreStart
            return false;
            // @codeCoverageIgnoreEnd
        }

        // Everything but 'date' has time element ('datetime', 'timestamp', 'time')
        return ($this->getModelInformation()->attributes[ $target ]->type == 'date');
    }
1192208
public function hasTimestamps()
    {
        $this->column('created_at')->dateTime()->nullable();
        $this->column('updated_at')->dateTime()->nullable();

        return $this;
    }
1206670
public function getDate()
    {
        if ($this->hasDatabaseField('Date')) {
            return $this->getField('Date');
        }
        return !empty($this->PublishDate) ? $this->PublishDate : null;
    }
466500
protected function getStartDate()
    {
        $StartDate = false;
        $objStartDate = \Database::getInstance()->prepare("SELECT
                                                           MIN(`tstamp`) AS YMD
                                                           FROM `tl_dlstatdets`
                                                           WHERE 1")
                                                ->execute();
        if ($objStartDate->YMD !== null)
        {
            $StartDate = \Date::parse($GLOBALS['TL_CONFIG']['dateFormat'], $objStartDate->YMD);

        }

        return $StartDate;
    }
876970
public function checkDate($value)
    {

        if ($value instanceof PointInTimeContract) {
            return $value->isValid();
        }

        if ($value instanceof DateTimeInterface) {
            return true;
        }

        // Support for legacy datetime objects like Zend_Date
        if (is_object($value) && method_exists($value, 'getTimestamp')) {
            return $this->checkInt($value->getTimestamp());
        }

        if ((!Type::isStringLike($value) && !is_numeric($value)) || strtotime($value) === false) {
            return false;
        }

        $date = date_parse($value);

        return checkdate($date['month'], $date['day'], $date['year']);
    }
358404
public function isReadOnly()
    {
        $readOnly = false;
        $fields   = $this->getPart(Zend_Db_Table_Select::COLUMNS);
        $cols     = $this->_info[Zend_Db_Table_Abstract::COLS];

        if (!count($fields)) {
            return $readOnly;
        }

        foreach ($fields as $columnEntry) {
            $column = $columnEntry[1];
            $alias = $columnEntry[2];

            if ($alias !== null) {
                $column = $alias;
            }

            switch (true) {
                case ($column == self::SQL_WILDCARD):
                    break;

                case ($column instanceof Zend_Db_Expr):
                case (!in_array($column, $cols)):
                    $readOnly = true;
                    break 2;
            }
        }

        return $readOnly;
    }
105607
public function hasFilters() {
		foreach ($this->columns as $col) {
			if ($col->hasFilters() === true) {
				return true;
			}
		}

		return false;
	}
1172758
public function isExpired()
    {
        $date = $this->getValidUntil();

        if ($date instanceof \MUtil_Date) {
            return $date->isEarlierOrEqual(time());
        }

        return false;
    }
1295131
public function getDate() : ?string 
    {
        if ( ! $this->hasDate()) {
            $this->setDate($this->getDefaultDate());
        }
        return $this->date;
    }
952264
public function isEmbargoed()
    {
        if (is_object($this->EmbargoedUntilDate)) {
            $this->EmbargoedUntilDate = $this->EmbargoedUntilDate->Value;
        }

        $embargoed = false;

        if ($this->EmbargoedIndefinitely) {
            $embargoed = true;
        } elseif ($this->EmbargoedUntilPublished) {
            $embargoed = true;
        } elseif (!empty($this->EmbargoedUntilDate)) {
            if (SS_Datetime::now()->Value < $this->EmbargoedUntilDate) {
                $embargoed = true;
            }
        }

        return $embargoed;
    }
196241
protected function isEndDateValid()
    {
        $this->valid_range_end->setTZById('UTC');
        return SwatDate::compare($this->value, $this->valid_range_end, true) <
            0;
    }
210865
public static function ruleDateTime()
    {
        return function ($input) {
            $date = null;
            try {
                $date = date_parse($input);
                return $date['warning_count'] === 0 && $date['error_count'] === 0;
            }
            catch(\Exception $e) {
                return false;
            }
        };
    }
306272
public function deleteOutdated(): bool
    {
        $keys = $this->db->keys('*');
        foreach ($keys as $key) {
            try {
                $packet = $this->getPacket($key);
                if ($packet->outdated()) {
                    $this->delete($key);
                }
            } catch (BadPacketException $e) {
                $this->delete($key);
            }
        }
        return true;
    }
252518
public function getDateValidationRule()
    {
        if ($this->isDateOrTime()) {
            if (!empty($this->dateFormat)) {
                return sprintf('date_format:%s', $this->dateFormat);
            }

            return 'date';
        }

        return null;
    }
599946
protected function isStartDateValid()
    {
        $this->valid_range_start->setTZById('UTC');
        return SwatDate::compare(
            $this->value,
            $this->valid_range_start,
            true
        ) >= 0;
    }
655329
public function column()
    {
        $columns = func_get_args();
        //
        if (Collection::count($columns) == 1 && is_array($columns[0])) {
            $columns = $columns[0];
        }
        //
        $target = '';
        //
        $i = false;
        foreach ($columns as $column) {
            if (!$i) {
                $target .= "$column";
            } else {
                $target .= ",$column";
            }
            $i = true;
        }
        //
        $this->columns = $target;
        //
        return $this;
    }
215681
public function login(): bool
    {
        if ($this->validate()) {
            $this->validateStatus();
            if (!$this->hasErrors()) {
                return \Yii::$app->user->login($this->_user, $this->remember ? DateHelper::TIME_DAY_THIRTY : 0);
            }
        }
        return false;
    }