Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 298132

[PP-2] Use form element of type date instead textfield when selecting a date in an exposed filter

$
0
0

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.

Change Record

Remaining tasks

Blocked on:

  • Investigate why the default value of the exposed filter is not picked up by the form (see #104). see #115
  • Hide 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 in core/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.


Viewing all articles
Browse latest Browse all 298132

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>