Problem/Motivation
When adding a datetime exposed filter I cannot simply select a date - I have to manually enter a date which is very bad UX.
Proposed resolution
Use a form element with '#type' => 'datetime'
so it's easy for users to select the date.
Remaining tasks
Blocked on:
- #2625136: Fix label visibility and add wrapper container for exposed numeric/date filters with multiple form elements
- #3078334: Datetime and Datelist elements should render as fieldsets
- #2419131: [PP-1] #states attribute does not work on #type datetime
Investigate why the default value of the exposed filter is not picked up by the form (see #104).see #115Hide time element for date-only type fields- Create a follow-up for the possibility for site builder to decide the widget type from the views management UI (see #48)
I think the new logic approach in #216 should also be happening incore/modules/datetime/src/Plugin/views/filter/Date.php
where we hide the time element for date-only fields. I didn't get that far, and wanted someone else to agree with the new logic approach before I got much further.- We clearly could use even more test coverage of all the possible combinations.
- We should decide if we really want to remove the placeholders and regexp from the existing filter and potentially break existing views that are using them (#215), or just add a whole new filter plugin with a different name. Then a) site builders can decide which interface they prefer and b) we don't have to worry about upgrade paths.
User interface changes
Exposed date filters will have input[type=date], and will leverage HTML5 handling if supported by the browser, or fall back to the polyfill if it doesn't.
For datetime w/ type date-only we should still use the datetime form element, but in date-only mode ($element['#date_time_element'] = 'none'
.
API changes
None.
Data model changes
None.