Problem/Motivation

I can't filter a view with a date or datetime column. Also prevents exposed filters of these columns.

Steps to reproduce

1. add a custom field to an entity with a datetime column
2. create a view of that entity
3. add that column as a filter to the view. There isn't an option to select the operator or value.

Proposed resolution

Add support for it.

Remaining tasks

User interface changes

API changes

Data model changes

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

mrconnerton created an issue. See original summary.

apmsooner’s picture

Yes, the views support is still a bit spotty in some areas. This would need a custom work and hopefully i can find some time. If anyone else wants to take a stab at it, The relevant files to look at for guidance are:

  • core/modules/datetime/datetime.views.inc
  • core/modules/datetime/src/Plugin/views
keshav patel’s picture

Version: 3.1.1 » 3.1.x-dev

apmsooner’s picture

Status: Active » Needs review

Filters, arguments and sort all available in the patch. Please test and add a review.

apmsooner’s picture

Title: Support views filters for date/time columns » Support views filters, arguments, & sort for date/time columns
benstallings’s picture

Status: Needs review » Reviewed & tested by the community

Great work, @apmsooner, that works perfectly as far as I can tell. Thank you!

  • apmsooner committed 83636452 on 3.1.x
    Issue #3509192 by apmsooner, benstallings: Support views filters,...
apmsooner’s picture

Status: Reviewed & tested by the community » Fixed

Thanks @benstallings,

If anyone finds any further issues with this, please open a new ticket but I think we are good to go so merging :)

apmsooner’s picture

Status: Fixed » Closed (fixed)