I'm looking for a way to filter a view so that content with a specified date that is older than the current date / time is not included in the view. I'm using the date module for views to add a future date. Once that future date is older than the current date, I'd like to have it automatically filtered out from the view. Is this possible?

Comments

Coupon Code Swap’s picture

Okay. Figured this out and it is possible. Just takes some time and experimenting to figure out how to use the views module. Very amazing how much flexibility there is.

------------------------------------
Themebot - Drupal themes and free web layouts
Coupons or Deals - Be a cheapskate and feel great

dadofgage’s picture

So what did you do to get this solved?

Coupon Code Swap’s picture

I added a filter for the expiration date I had set. The filter is set to only show nodes greater than or equal to "now", based on the expiration field.

------------------------------------
Dell Coupons | Lenovo Coupons - Be a cheapskate and feel great!
Themebot - Drupal Themes

steevithak’s picture

I'm trying to do the same thing for an event list. Can you be any more specific about how you did it? So far, I don't see any way to use the "filters" option. It doesn't show my date field as an option. The "sort criteria" shows the date field as an option so I'm not sure why filters can't see it.

Anyway, if someone could point to a step-by-step on how do this that would be great. Thanks!

haleak’s picture

For anyone who comes across this, I just had the same problem - my CCK date field was showing up as an option under Filters - and I figured out the answer is to filter by Date:Date. That will give you options to choose which field on the node (including custom cck fields) you want to use as your date. Then you can set if you want the date to be less than, greater than, or equal to a relative or absolute value.

Sourcery’s picture

Good explanation, a bit tricky before you relize that Date fields are put together under date, while all other custom fields are under content.... Thanks again.

perandre’s picture

I can't get this to work. I use date:date and set the filter to equal or greater than, and apply the relative value 'now' (see screenshot). The resulting view still shows dates older than today. Why?

Screenshot:
http://pesh.no/personlig/date_filter.png

bluemuse’s picture

I can filter by node type, by node published (yes), but when I try Date:Date with From date < now, I still get future dates showing up in my View. I tried making the dates absolute, and that worked, but naturally this isn't something I'd like to update manually on a daily basis. Is this is a bug? Anyone else besides perandre having the same issue?

perandre’s picture

@Blue Muse: This was a bug in Date module, and is fixed in the dev release. Enjoy :)

bluemuse’s picture

I downloaded the latest dev version, but I still have the same problem. My view continues to show events that are upcoming, when I have set it to show only events less than now.