Release 2.16 (#4780)
This commit is contained in:
@@ -16,12 +16,13 @@ final class DateTimeFormat extends Constraint
|
||||
public const INVALID_FORMAT = 'kimai-datetime-00';
|
||||
|
||||
protected const ERROR_NAMES = [
|
||||
self::INVALID_FORMAT => 'The given value is not a valid datetime format.',
|
||||
self::INVALID_FORMAT => 'This value is not a valid datetime.',
|
||||
];
|
||||
|
||||
public ?string $separator = null;
|
||||
public ?string $message = 'This datetime format is invalid.';
|
||||
public ?string $message = 'This value is not a valid datetime.';
|
||||
|
||||
// Before: The given value is not a valid datetime format.
|
||||
public function getTargets(): string
|
||||
{
|
||||
return self::PROPERTY_CONSTRAINT;
|
||||
|
||||
@@ -62,7 +62,7 @@ final class DateTimeFormatValidator extends ConstraintValidator
|
||||
}
|
||||
|
||||
if (false === $valid) {
|
||||
$this->context->buildViolation('The given value is not a valid datetime format.')
|
||||
$this->context->buildViolation(DateTimeFormat::getErrorName(DateTimeFormat::INVALID_FORMAT))
|
||||
->setTranslationDomain('validators')
|
||||
->setCode(DateTimeFormat::INVALID_FORMAT)
|
||||
->addViolation();
|
||||
|
||||
Reference in New Issue
Block a user