Fix validation of fixed date

This commit is contained in:
Julien Fastré 2022-11-07 18:20:34 +01:00
parent 86be95ac43
commit 50db96ffbc

View File

@ -48,8 +48,8 @@ class PickRollingDateType extends AbstractType
'class' => RollingDate::class, 'class' => RollingDate::class,
'empty_data' => new RollingDate(RollingDate::T_TODAY), 'empty_data' => new RollingDate(RollingDate::T_TODAY),
'constraints' => [ 'constraints' => [
new Callback([$this, 'validate']) new Callback([$this, 'validate']),
] ],
]); ]);
} }
@ -60,8 +60,7 @@ class PickRollingDateType extends AbstractType
$context $context
->buildViolation('rolling_date.When fixed date is selected, you must provide a date') ->buildViolation('rolling_date.When fixed date is selected, you must provide a date')
->atPath('roll') ->atPath('roll')
->addViolation() ->addViolation();
;
} }
} }
} }