New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Form] DateTimeType remove seconds with HTML5 #48076
Comments
From what I understood, in theory, the format without the seconds is invalid because the value should respect the We could support it too but do we want to? |
Curently i solved it with a DataTransformer DateTimeNoSecondsTransformer.php
Would be more convenient to have this integrated in symfony forms though. |
The Since it's "working" when the form doesn't have data, I guess it could actually be treated as a bug. Especially since Friendly ping to form experts @xabbuh @yceruto |
Probably this is something nobody ever thought about. IIRC. the handling in |
Description
When passing a DateTime object to DateTimeType we can not remove the seconds from the HTML5 datepicker.
There is currently no official way to disable seconds in a HTML5 dateTime input, but by not passing the seconds the seconds picker is omitted.
However we cannot set the time format in DateTimeToHtml5LocalDateTimeTransformer.
Also no
format
option can be used together with html5.results in
So i would suggest to either allow
format
option or add a dedicatedwithout_seconds
option for HTML5 andsingle_text
.Example
No response
The text was updated successfully, but these errors were encountered: