0

i have content type in Drupal 6 that has date field, that is date when some historical event happened.

I want to create a view that will show all historical events that happened today.

I created 2 computed fields that will take data from that date field, one for month and other for day. Also i created view and added this two fields as filter. And when i enter exact numbers in filter, like 9 and 20 it shows the articles that happened on this month and day.

But since its not exactly a date field i cant enter relative values like "now" or "today" and someone needs to change this manually every day.

What is best way to get this filter take todays day and month.

1 Answer 1

0

OK i found the solution.

I had to use Arguments ( contextual filters ), and in argument i would use php code as validator and than just get todays day with simple code:

$day = date("j");
return $day;

Hope this helps someone in future.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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