- Issue created by @dan_metille
- Assigned to nidhish
- ๐ฎ๐ณIndia rakesh.regar Rajasthan, India
rakesh.regar โ made their first commit to this issueโs fork.
- Merge request !4Issue #3502904 :Fixes Non-required field_time fields save the current time as default. โ (Open) created by rakesh.regar
- ๐ฉ๐ชGermany jox
We're also affected by this issue. I tried both patches from #3 and #6, but unfortunately, neither of them fixes the mentioned behavior.
- ๐ฉ๐ชGermany jox
I created a patch that fixes the main issue by making two changes:
- Leave time fields empty when they are not required, instead of setting the current time.
- Leave time range fields empty when they are not required, and avoid the error "The end time cannot be earlier or equal to the start time".Known limitation:
There is still an open issue: if only one value of a time range is entered (e.g., only "Start time" is filled and "End time" is left empty), the entered value will be silently discarded, and both fields will be saved as empty.I am willing to invest some more time to fix this properly (e.g., by adding a validation error if only one side of the range is filled).
Testing steps:
- Create a non-required time or time range field.
- Submit the form without entering any time: the field stays empty (โ ).
- Submit the form with both "Start" and "End" filled in: the time range saves correctly (โ ).
- Submit only one of "Start" or "End": currently still silently ignored (โ ๏ธ to be fixed).