0

I want to show content in view last 30 days only. I managed to create the view and set the filter as "Content: Post date" but got struck in getting correct Value type.

I tried the following filter in views

"Content: Type (= Document) Content: Post date (<= -30days)"

Any help is really appreciated.

Nuwan Fernando
  • 133
  • 1
  • 1
  • 6

2 Answers2

1

try this:

Content: Post date (>= -30days)

rather than this:

Content: Post date (<= -30days)

Post date is a unix timestamp in Drupal. We'd want to get the most recent, therefore the largest numbers would be the most recent, hence greater than or equal to the unix timestamps from 30 days ago.

oknate
  • 1,068
  • 10
  • 14
0

You can alter the view using hook_alter_view and here you can check weather the content is posted in past 30 days period, in this condition automatic only 30 days data will be appeared.