Prado\Web\UI\WebControls\TRangeValidator::isValidDate PHP Method

isValidDate() protected method

Uses pradoParseDate and strtotime to get the date from string.
protected isValidDate ( $value ) : boolean
return boolean true if within range.
    protected function isValidDate($value)
    {
        $minValue = $this->getMinValue();
        $maxValue = $this->getMaxValue();
        $valid = true;
        $dateFormat = $this->getDateFormat();
        if ($dateFormat !== '') {
            $formatter = new TSimpleDateFormatter($dateFormat);
            $value = $formatter->parse($value);
            if ($minValue !== '') {
                $valid = $valid && $this->isGreaterThan($value, $formatter->parse($minValue));
            }
            if ($maxValue !== '') {
                $valid = $valid && $this->isLessThan($value, $formatter->parse($maxValue));
            }
            return $valid;
        } else {
            $value = strtotime($value);
            if ($minValue !== '') {
                $valid = $valid && $this->isGreaterThan($value, strtotime($minValue));
            }
            if ($maxValue !== '') {
                $valid = $valid && $this->isLessThan($value, strtotime($maxValue));
            }
            return $valid;
        }
    }