-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
Closed
Description
Symfony version(s) affected
symfony/form 5.4.45
Description
The following code creates an HTML widget that has the seconds fixed to the value in $time. Attempting to submit the form with different seconds makes the browser reject the request.
This is because the time is formatted with seconds and current behaviors don't handle that well.
Documentation mentions a with_seconds option, disabled by default, which I thought it would change the format to exclude seconds, but it doesn't.
This makes date/time forms a bit unsuable.
How to reproduce
$form->add('date', DateTimeType::class, [
'data' => $time,
'input' => 'datetime_immutable',
'widget' => 'single_text',
]);Possible Solution
When with_seconds option is disabled, formatting of time should not include seconds.
Additional Context
No response