I have a content type event containing a datetime field with from and to date. I want to be able to filter by duration of an event and I want to show the duration - but I don't want to use computed field.

How can I provide a field for views which calculates the difference between from and to date?
How can I add the filter? Both should use the mysql datediff function. I hope this solution is with sufficient performance, or would you recommend to use computed fields?

I use views for a couple of years, but I recently started to have a deeper look on views api. May somebody could point me to the way how to solve this problem. Does anybody know some similar problem already solved by a module, just to get a feeling how to start. THANKS!

Comments

seaneffel’s picture

Very similar issue open for D7:
http://drupal.org/node/1957702