Jump to:
| Project: | Views |
| Version: | 7.x-3.5 |
| Component: | Miscellaneous |
| Category: | support request |
| Priority: | minor |
| Assigned: | Unassigned |
| Status: | closed (fixed) |
Issue Summary
This is a Views / Date request.
I am trying to create a view that shows nodes created last week. Specifically at any point in the current week I want to show nodes created Mon-Fri the previous week (user visits site on January 3rd, the view would display all nodes created between December 24th to the 28th).
Using something like '-7 days' does not work as it would limit the results. Ie. if user visits site on Wednesday, the last week's content would show only last Wednesday and not the entire Mon-Fri range.
I have created a view that shows nodes created this week by using date range from 'last sunday' to 'this saturday', is there a way that could be offset back one week?
Thanks for any pointers!
Comments
#1
To do that you'd probably need to use hook_views_pre_build() and manually switch the numbers around, as your needs are simply more complex than you can do through the UI. With that, you can calculate dates to your heart's content.
#2
Automatically closed -- issue fixed for 2 weeks with no activity.