Problem/Motivation
The 7.x Date module allowed the field to have an optional or required end date. D8 always requires the end date.
Proposed resolution
Make end_value in DateRangeItem optional, add validation constraint via configuration.
Key questions
5 key questions have recurred again and again over the life of this issue:
1. Is the start date optional too? NO
2. What value is stored in the end date property if it is left empty in the widget? NULL
3. Does the optional_end_date setting live in the field config or field storage config? STORAGE
4. How are optional and non-optional properties distinguished in the widget? STAR ON REQUIRED PROPERTIES BUT ONLY ON FIELD IF ALL REQUIRED
5. How are missing end dates displayed in the formatter? ONLY START DATE IS SHOWN
Remaining tasks
If the start date is missing, stop deleting the end date on saving the form. (See #84.)- If missing, indicate that the end date is unknown/unspecified on display. (See #84.)
User interface changes
Field storage settings form:
![field storage settings form]()
Only start date is displayed when end date is missing:
![end date missing]()
History of discussion
#35 "I think we will have to `->setRequired(FALSE)` in the field definition, and then set required on the element in the widgets, based on the settings. Still need a update hook at the end, though."
# 39 UX discussion
#45 first patch from mpdonadio
#48 "Should the optional_end_date setting be moved to the field config instead of the field storage config?"
#63 should we allow start date optional
#64 'datetime_iso8601' datatype has never been set to optional in core
#76 no impact on json_api
#84 discussion around how we should display missing end date
#94 further discussion around what values to store & display if unknown end date
#139 first patch that added optional start date
#144 proposal about how to handle required indicators for optional field parts
#171 removed optional start date from patch
API changes
Data model changes