Closed
Description
Symfony version(s) affected: 5.2.6 (probably others)
Description
If you pass a reference time to a TimeType field with input type array it will assume the time properties of the reference date when the field value was 0
How to reproduce
- Get a TimeType form field
- Set input to array
- Add a reference_date
- Try to set it to 0
Possible Solution
It's caused by https://github.com/symfony/form/blob/8822890bdb6267f8d1c027f697db4bd83c2afc55/Extension/Core/DataTransformer/DateTimeToArrayTransformer.php#L170 cause empty views 0 as empty value and will thus take the value of the reference date