So, I finaly figured out that it’s possible to write your own scope
Unfortunately my code doesn’t work. It’s keeps saying “no events”.
add_filter( 'em_events_build_sql_conditions', 'my_em_scope_conditions',1,2);
function my_em_scope_conditions($conditions, $args){
if( !empty($args['scope']) && $args['scope']=='third-month' ){
$now = time();
$future = strtotime('+2 months', $now);
$start_date = mktime(0,0,0,date('m',$future),1,date('y'));
$end_date = mktime(0,0,0,date('m',$future)+1,0,date('y'));
echo date('d-m-Y', $start_date)," tot " ,date('d-m-Y', $end_date);
$conditions['scope'] = " (event_start_date BETWEEN CAST('$start_date' AS DATE) AND CAST('$end_date' AS DATE)) OR (event_end_date BETWEEN CAST('$end_date' AS DATE) AND CAST('$start_date' AS DATE))";
}
return $conditions;
}
add_filter( 'em_get_scopes','my_em_scopes',1,1);
function my_em_scopes($scopes){
$my_scopes = array(
'third-month' => 'third month from current date'
);