I am trying to filter my view by using a date range so that it shows all the activities at an event:
Activity Start >= Event End & Activity End <= Event Start
To do this I have set up a view to show all Activities with a contextual filter to allow the Event dates to be accessed.
I added the 4 fields to my table: Activity Start, Activity End, Event Start and Event End.
My $Row data when adding a Global:php filter criteria now has the four variables accessible to carry out the comparison above:
Activity Start: $Row->field_start_date_and_time Activity End: $Row->field_start_date_and_time_1 Event Start: $Row->field_start_date_and_time_2 Event End: $Row->field_start_date_and_time_3
I am using views_php 7.x-2.x-dev - which fixed the issue of $row not populating.
I am trying to write the above comparison in php and am not getting results as expected (i thought this would be the easy bit, I have spent a long time getting this far).
However, it appears that the date format is not being read correctly as it is not returning any results - I have done some research which would indicate it might need to be in unix timecode to do the comparison accurately.
Is this correct? What does the code look like to do it?
Any suggestions greatly appreciated.