Problem/Motivation
In the work on #2794481: Allow end date to be optional we saw some problems with DateRange validation UX. At the moment the error "This value should not be null", and the way the field errors are highlighted, is confusing. This ticket can be worked on in isolation of #2794481: Allow end date to be optional but it's probably easier as a follow up.
Steps to reproduce
- Standard profile
- Install daterange module
- Add a daterange field to *page* node, make it *not required*
- Go to /node/add and start to create a page
- Leave the start date empty. End the end date. (Reverse has the same outcome)
- (Making sure to add required fields like title then) submit.
Current: "This value should not be null" error, and both fields are highlighted red.
Expected: "You must add a start date" or "You must add both dates" and only the start date should be highlighted red.
Proposed resolution
At the moment this gets a NotNull constraint and if you don't enter either date you get a more user friendly HTML5 validation. I think the daterange module should have it's own specialised constraint, especially as we make the end date (and later start date) optional.
If #2794481: Allow end date to be optional is finished it should cover optional end dates.
Comments
Comment #2
sime