Posted by greta_drupal on September 23, 2010 at 9:27pm
What is the correct syntax for referencing current date or date part for Node Post Date filter?
Example: Want to show ony nodes published prior to current year.
Date(Y) isn't valid.
What is the correct syntax for referencing current date or date part for Node Post Date filter?
Example: Want to show ony nodes published prior to current year.
Date(Y) isn't valid.
Comments
It would be easier to achieve
It would be easier to achieve with arguments and the Date module, because that has a "granularity" setting, which you can set to Year.
Ryan Price
DrupalEasy Podcast
Set Date filter to "greater
Set Date filter to "greater than or equal to", then set the value to "-1 year".
Date filter uses PHP's strtotime() function, more examples at: http://php.net/strtotime
Orlando, FL Web Developer | http://www.garethsprice.com/
That will yield a date -1
That will yield a date -1 year from current date. Not what I want. I want it based on calendar year, not current date.
I believe the php strtotime()
I believe the php strtotime() function would understand "last year", though, if that's what you were after. You would still use the "less than / equal" operator.
(I still say views arguments, not filters, is the right answer to your question)
Ryan Price
DrupalEasy Podcast