Creating a View to list content with a datetime field, filtered by date < today, caused no results to be displayed.
Problem/Motivation
Creating a View to list content with a datetime field, filtered by date < today, caused no results to be displayed.
The query I was doing:
WHERE (( (node_field_data.status = '1') AND (node_field_data.type IN ('event')) AND (DATE_FORMAT(node__field_date.field_date_value, '%Y-%m-%d\T%H:%i:%s') < DATE_FORMAT('1969-12-31T23:00:00', '%Y-%m-%d\T%H:%i:%s')) ))
Proposed resolution
Update views filter plugin for DateTime to always use the current request time.
Remaining tasks
Determine if this is the intended functionalityReview existing patch/make sure tests are correct
User interface changes
None.
API changes
None.
Data model changes
None.