8

If I create a view, I can add a filter that filters on a relative value on some built-in date field, such as Post date. For instance, the screenshot below shows a filter I've created that will show articles posted in the last four days.

filter with relative value

Unfortunately, there is no date field type in core. To get a date field type, you can install the Date module. This allows you to create nice widgets for inputting dates. However, I've found no way to filter the date fields created by the date module by a relative value (like the filter shown above for Post date). There are Is equal to and Is not equal to operators, but no greater than operator, in the "Configure filter criterion" screen.

filter that do not offer a relative value

I believe that this should be possible, as is also evident from Nigel Waters's upvoted answer to this question: view to show content with future date. However, the exact steps one must take to reproduce the result shown in the upvoted answer eludes me.

  • It's not my answer, I only provided a screenshot. I was about to post an answer, but Nigel Waters was faster so I only added a screen to his, and my answer got deleted or not posted at all (can't remember and I'm not 10k atm). I wish I remembered how I did it :( – Mołot Nov 28 '13 at 10:22
9

I've found the solution. (Doh!)

It turns out that there is a module named Date Views that comes as part of the Date package. If you enable this, the filter criterion screen changes, and you can use relative operators.

Filter criterion

  • Too simple to even remember :D Can you add a screenshot? I can't as I have chosen installed and it looks bad :P – Mołot Nov 28 '13 at 11:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.