Open
Description
Description
Given a form type with a date time field using two simple text widget, it is currently not possible to use the error_mapping
option on the date and time children.
After some investigation, I found that the DateTimeType
defines the error_bubling
to true
for the date and the time fields. In the example below, when a violation is created, is is mapped to startsAt.date
but is bubbled up to startsAt
.
I could work on a PR as I don't see any easy fix. An option like date_error_bubling
/time_error_bubling
would do the trick ?
Or should I add date_options
/time_options
that would override the options passed to these fields ?
Example
$builder
->add('startsAt', DateTimeType::class, [
'date_widget' => 'single_text',
'time_widget' => 'single_text',
'error_mapping' => [
'.' => 'date',
],
]);