0

I'm having troubles figuring out how to filter by date using the date range module from Drupal 8 core.

I, of course, found this post: How to filter a View by Date Range (start, end)?

But this doesn't tell me how to use the filter, it only makes the filter work better. So I used this patch but how to make this filter work?

I'm creating a calendar with cultural events and I want to be able to filter on date and genre with exposed filters. So let's say I have a design event from 05-01-2018 until 05-02-2018 (dd-mm-yyyy).

And I want it to show up when I'm searching for what is going on today or this month that concerns design? How to set up the filter for this?

What is the best and most simple way to do this?

1 Answer 1

0

I found a solution for this I have two exposed filters for my begin_date (begin_filter_1 and begin_filter_2) and two exposed filters for my end_date (end_filter_1 and end_filter_2).

  • When the begin_filter_1 is entered, this input will be copied to end_filter_2.

  • When the end_filter_1 is entered, this input will be copied to begin_filter_2.

No the filter looks like this

Published Yes AND Category - Exposed (Taxonomy Term) = Design Begin Filter 1 - Exposed >= Begin_Date End Filter 1 - Exposed <= End_Date AND Has Taxonomy Term - Exposed = Design Begin Filter 2 - Exposed(but hidden via css) <= Begin_Date End Filter 2 - Exposed(but hidden via css) >= End_Date 

As you can see in the second Group I use a different filter to filter on the category. This is because of a bug in Drupal Core: Complex Filter Criteria no Results

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.