Release 2.16 (#4780)

This commit is contained in:
Kevin Papst
2024-05-01 14:24:24 +02:00
committed by GitHub
parent 8f8d228fb3
commit 99c296a751
150 changed files with 2498 additions and 1905 deletions

View File

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

View File

@@ -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();