Ah I got it. Had a couple problems here:
- I had to remove
!is_admin() check since any ajax request validates that to true
- I added
defined( 'DOING_AJAX' ) && DOING_AJAX to catch the date-range query made via ajax.
Now this works as expected, the entire logic call now is:
if( ( defined( 'DOING_AJAX' ) && DOING_AJAX ) || $query->is_main_query() && !is_tax('tribe_events_cat') && !tribe_is_event() && ( tribe_is_past() || tribe_is_upcoming() ) )