3

I want to display all nodes created on lets say, March 30 (between 1990 to 2014). Views contextual filters seems to display nodes posted on March 30 this year, how do i make the contextual filters include content posted on March 30 between lets say 1990 till 2014?

0
1

The custom module method is:

$nodes = node_load_multiple(db_query("SELECT nid
    FROM node
    WHERE MONTH(FROM_UNIXTIME(created)) = 3 AND DAY(FROM_UNIXTIME(created)) = 30 AND
    YEAR(FROM_UNIXTIME(created)) BETWEEN 1990 AND 2014")->fetchCol());

As far as I'm aware this isn't possible using the views UI so you would have to use hook_views_query_alter to get this working using views.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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