Background: I need to produce some tables in Views that show entities that have had a certain status (based on a taxonomy field) for x number of business days. I’ve already set up fields and rules so that each time the entity has its status changed a datetime field is filled with the current date and time. Next I created a custom module that added custom fields to the View showing how many business days had elapsed since the date and time. I thought all was groovy until I realized I couldn’t filter on these custom fields (for reasons I know understand). So I’ve gone partially back to the drawing board to redo this concept, but as a custom filter instead of a field… but I’m having trouble figuring out how to create this custom filter in my module. I figured I can reuse the php script that takes the date field and the current date to calculate how many business days have elapsed. Except for the business days requirement, I can almost do what I want out of the box using a Views date filter with an operator of "is less than or equal to" and an offset value (so I only want to show entities that are older than two days, so I used "-2 days" for the value).
So basically I’m not sure the best way to approach this. My hope is to have a filter with a field to set the entity field and the offset value, but if its easier I’m also okay with just creating multiple for fields for each variation I need.
So I guess I need the filter to take the field value, run it through my workday script to return the number of work days elapsed, and then show all entities where that number is greater than 2.