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;
}
}