| Q |
A |
| Bug? |
yes |
| New Feature? |
no |
| Bundle Version |
2.5.4 |
| Sulu Version |
2.6.5 |
Actual Behavior
Rendering Date (Symfony\Component\Form\Extension\Core\Type\DateType) doesn't work because of an error.
Expected Behavior
DateType should be rendered with default format without error
Steps to Reproduce
Add Date form field in form. This throws an error on page rendering: Cannot use the "format" option of "Symfony\Component\Form\Extension\Core\Type\DateType" when the "html5" option is enabled.
Possible Solutions
DateType field have by default html5 option value set to true.
But this is incompatible with the value of the format option set to IntlDateFormatter::LONG
// Sulu\Bundle\FormBundle\Dynamic\Types\DateType
$type = TypeDateType::class;
$translation = $field->getTranslation($locale);
if ($translation && $translation->getOption('birthday')) {
$type = BirthdayType::class;
}
$options['format'] = \IntlDateFormatter::LONG;
$options['input'] = 'string';
$builder->add($field->getKey(), $type, $options);
Could dateformat be configured in sulu form yaml config file, and html5 set to false?
Maybe this is relative to this issue : #49