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

Date/time Views filter tries strotime() relative to Unix epoch

$
0
0

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 functionality
  • Review existing patch/make sure tests are correct

User interface changes

None.

API changes

None.

Data model changes

None.


Viewing all articles
Browse latest Browse all 295177

Trending Articles



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