Hello,

I'm using Views to display node titles in a block, sorted by the "authored on" date in descending order. Is there a way for me to have it only show the dates from a specific time frame?

For example, if I create two posts "authored" in September and then three posts authored in October, it shows the October posts first. Can I have it only display posts from September? My idea is to show upcoming events, but I want to be able to type them well in advance, but only show those coming in the next month to the public in the sidebar block.

Comments

gforce301’s picture

I believe that enabling a date filter should accomplish what you need.

edit:
In other words add a either the Node: Updated Time filter -or- the Node: Created Time filter and configure it for a range.

JonMB’s picture

Thanks for the swift reply. I have the Node: Created Time filter.

Can you explain how to configure it for a range?

gforce301’s picture

Well, in the version of views that I have on the site I have open it says this under the filter when I turn it on:

This filter allows nodes to be filtered by their creation date. The "Value" can either be a date in the format: CCYY-MM-DD HH:MM:SS or the word "now" to use the current time. You may enter a positive or negative number in the "Option" field that will represent the amount of seconds that will be added or substracted to the time; this is most useful when combined with "now". If you have the jscalendar module from jstools installed, you can use a popup date picker here.

and there is a selector at the left with choices like: is greater than, is greater than or equals, is equal to, etc...

So the above help text says I can put date in the 'Value' field and a positive or negative number in the 'Option' field. If you say put "now" in the value field and set the selector to 'less than or equals' and then put 1209600 (14*24*60*60 = the number of seconds in 2 weeks) in the option box, you will get only the posts who were created from now up to and including ones 2 weeks in the future.

JonMB’s picture

Interesting. I'm not sure if my version of Views has that ability. I'll look into it some more, thanks!

Edit: Aha, that works perfectly. I just needed to change the seconds to 2419200 (4 weeks) to suit my needs. Thank you very, very much. You saved me a lot of time.

Note that I confused myself a little bit. I kept looking at the Node: Created Time FIELD, instead of the FILTER.

gforce301’s picture

Glad I could help.