Problem/Motivation
Currently, there is no way to prevent the datepicker from setting a default value. Even if you set an empty field value, the widget will use the current time.
Proposed resolution
There are settings available which allow for disabling of the initTime and defaultValues. We could add them as a setting.
Remaining tasks
Write patch. Review. Test. Commit.
User interface changes
An additional checkbox for disabling default values. This ensures backward compatibility.
API changes
We add 2 data attributes: initTime and defaultSelect.
Data model changes
None.
Release notes snippet
An new form display setting "Disable default value". When checked, no default values will be used in the datepicker.
Comments
Comment #2
askibinski commentedComment #3
lendudeThis should use $this->t() too, but since half that method uses it and half of it doesn't *shrug*
Manually tested this with date fields and date range fields and works as specified.
Comment #4
askibinski commentedI think this would need to be split up further and needs more investigation because with above patch you also need to unset the default value in the Drupal field. However, it might be that the problem is in the JS library as the 2 options mentioned above do not work as expected.