1

I need to return nodes that have a date within a date range of Thursday to Wednesday. I have tried many different combinations, but none do the trick all the time.

The closest I can get is to set the Date From to: "Last Thursday" and the Date to, to: "Wednesday"

This works whenever the day isn't Thursday. As a demo: Today is Saturday 24th. The Filter would return everything from Thursday 22nd through to Wednesday 28th. Perfect! However on Thursday 22nd, it returns everything from Thursday 15th through to Wednesday 28th. A whole extra week of content I don't want!

Any ideas on how to combat this in Views?

2
  • I hate to sound like a broken record but I must ask - what version of views are you using?
    – Jukebox
    Commented Sep 22, 2011 at 2:26
  • It's Views 3 - Drupal 7. Commented Sep 24, 2011 at 3:07

1 Answer 1

1

I guess that date filter with is between option filter could be a possibility if you alter the query used by your View, using a custom php builded by you to calculate values (to use and send inside query) according the current day. see this article http://www.appnovation.com/using-hook-views-query-alter about how to use query_alter hook to alter the queries used by your view.

2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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