[Form] Added right HTML types to Datetime/Date/Time types if single_text is true
This commit is contained in:
parent
e193452742
commit
6d5ad3b289
@ -124,6 +124,10 @@ class DateTimeType extends AbstractType
|
||||
public function buildView(FormView $view, FormInterface $form)
|
||||
{
|
||||
$view->set('widget', $form->getAttribute('widget'));
|
||||
|
||||
if ('single_text' === $form->getAttribute('widget')) {
|
||||
$view->set('type', 'datetime');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -142,6 +142,10 @@ class DateType extends AbstractType
|
||||
{
|
||||
$view->set('widget', $form->getAttribute('widget'));
|
||||
|
||||
if ('single_text' === $form->getAttribute('widget')) {
|
||||
$view->set('type', 'date');
|
||||
}
|
||||
|
||||
if ($view->hasChildren()) {
|
||||
$pattern = $form->getAttribute('formatter')->getPattern();
|
||||
|
||||
|
@ -130,6 +130,10 @@ class TimeType extends AbstractType
|
||||
->set('widget', $form->getAttribute('widget'))
|
||||
->set('with_seconds', $form->getAttribute('with_seconds'))
|
||||
;
|
||||
|
||||
if ('single_text' === $form->getAttribute('widget')) {
|
||||
$view->set('type', 'time');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user