-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Form] TimeType does not work in new Edge #35989
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
Comments
Can you please be a bit more precise? What does "does not work" mean? |
@xabbuh Apologies, I submitted the bug report before typing the info in. Have updated the description now. |
My current work around is to add an event listener to strip the parts of the value that aren't expected by the The $builder->get('time')->addEventListener(
FormEvents::PRE_SUBMIT,
function (FormEvent $e) {
$e->setData(
implode(
':',
array_slice(
explode(
':',
explode(
'.',
$e->getData()
)[0]
),
0,
2
)
)
);
}
); |
@jackbentley Does that mean that Edge will always submit the value in the |
@xabbuh Correct. And it looks like the type is expecting |
@jackbentley Can you confirm that #36020 fixes this issue? |
This PR was merged into the 3.4 branch. Discussion ---------- [Form] ignore microseconds submitted by Edge | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | Fix #35989 | License | MIT | Doc PR | Commits ------- 20971df ignore microseconds submitted by Edge
Symfony version(s) affected: all
Description
When submitting a form via Edge using the
TimeType
; Edge will submit the value with both seconds and milliseconds every time regardless of thestep
attribute (e.g.20:11:00.000
). This is valid according to W3C.It looks like Symfony is unable to parse the milliseconds in the
DateTimeToStringTransformer
and this then causes an invalid value.This only seems to be an issue since Edge has moved to Webkit.
How to reproduce
Possible Solution
Additional context
The text was updated successfully, but these errors were encountered: