Show the expected input format if a date-and-time input is not valid

refs #6778
This commit is contained in:
Eric Lippmann 2015-05-19 11:22:23 +02:00
parent b5a0f7950e
commit ab7c529094
1 changed files with 1 additions and 2 deletions

View File

@ -5,7 +5,6 @@ namespace Icinga\Web\Form\Validator;
use DateTime;
use Zend_Validate_Abstract;
use Icinga\Util\DateTimeFactory;
/**
* Validator for date-and-time input controls
@ -68,7 +67,7 @@ class DateTimeValidator extends Zend_Validate_Abstract
}
if ($dateTime === false || $dateTime->format($format) !== $value) {
$this->_error(self::INVALID_DATETIME_FORMAT, DateTimeFactory::create()->format($baseFormat));
$this->_error(self::INVALID_DATETIME_FORMAT, $baseFormat);
return false;
}
}