I want to make a view of items that have been created in the current week. My view is a price-comparison, so old data is unwanted. How do I configure the view to take only the content/nodes from this week.

I think that I probably will have to look into arguments. But how can I make my argument be called so it always looks at current week????

My understanding of arguments is that I can make one view and decide with the argument which of the 52 weeks I will look at. But I dont want that. I want to dynamically look at current week in the view.

Please help.

Morten E.

Comments

excaliburst’s picture

In other words how do I make an argument that will include only current/this week items in a view... ?

Morten

HTB’s picture

It feels like this functionality should be easy to implement. all we need is access to a timestamps. but I cant find anyway to access timestamps.

However, I happened to note something within the SQL like this:
***CURRENT_DATE***
You will spot this every time there is a filter based on dates. I haven't found anyway to access it though :-(

all we need is to be able to pull this stunt
(relevant_time - time stamp) relevant time is a week month etc so it would look like this
(current_day-7) day for a current week filter.

I really dont want to result to using PHP, it would feel like using ducktape to plug a leak!

esmerel’s picture

Status: Active » Fixed

If you're using a date type of field, Node: Post date for example, you can use a filter on that field. With that filter, you can use an offset (it's part of the filter configuration) to use -7 days or whatever. I think that'll do what you're looking for.

excaliburst’s picture

Status: Fixed » Active

Thanks for you thoughts, but Esmerel, if I use a rolling 7 day filter, and one week fill out the content on friday and the next week on monday, then I would have mixed content from 2 weeks. So this is not a viable solution. I need it to be bulletproof.

I should not have to manually enter week no. in the content to filter on. I should be able to actually have Drupal know from the date, which week no the node where created.

Thanks

Morten

esmerel’s picture

Status: Active » Fixed

Something I should've seen before, but node arguments have "Node:Created Week" and "Node: Updated Week" as potentials, using the week number (1-52). Maybe some fiddling with that would give you what you're trying to get to?

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.