Wednesday, May 16, 2012

PHP relative date filters in Drupal 7 view

I'm building a view in Drupal and am having an issue setting the filter criteria around a date.

I have a content type of "film of the week". It stores basic film attributes such as film name, director, guidance rating, starring, etc etc. It also has a date saying when the film starts as film of the week, and when it ends.

Currently, film of the week (Film A) runs from Tuesday through until the following Monday. the next Tuesday a new film (Film B) is displayed as film of the week.

When filtering using the operator "is equal to" and the relative end date "next Monday" I thought I would always get back the current film of the week. However, on a Monday I should see Film A as it still active but "next Monday" is the following week so I only see "Film B".

Any suggestions how I can say "if today is not Monday show me next Monday, otherwise show me today" in this context?

Thanks in advance.

No comments:

Post a Comment