I have a View containing a list of events. There is a date field on the event content type which contains start and end time:
There is a filter for start time, which is setup using the Views Between Dates Filter:
This means that entering 11:00am
in the filter will ensure that the event with time 10:00 AM to 3:00PM
exists in the results since 11 falls between 10 and 3.
The full result set might look like the following when using 11am
for the filter:
7am to 3pm
8am to 12pm
9am to 11:30pm
11am to 12:00pm
11am to 1pm
How can I create a custom sort, such that the exact matches for start time are ordered first? These are the results I need:
11am to 12:00pm
11am to 1pm
7am to 3pm
8am to 12pm
9am to 11:30pm
Is there a way to create a custom sort handler for views using filter values?
EDIT: I'd hoped I could use hook_views_post_execute
to re-order the data but I'm using a pager, so only the first 10 results exist in $view->result