Hi Alan,
This is possible as of 2.13.0, with the following lines of code:
add_filter( 'eventorganiser_fullcalendar_query', 'my_hide_past_events' );
function my_hide_past_events( $query ){
$query['showpastevents'] = false;
return $query;
}
That should (ideally) live in a utility plug-in. However, the calendar is cached, so you will probably want to add these lines too:
add_filter( 'pre_transient_eo_full_calendar_public_priv', '__return_null' );
add_filter( 'pre_transient_eo_full_calendar_public', '__return_null' );
The set up with regards to events and bookings that you currently have sounds like the correct one for context you describe.
For styling events which have already started (that is, events in which their first occurrence has started), you can use the following snippet to add any class:
add_filter( 'eventorganiser_event_classes', 'add_my_event_class', 10, 2 );
function add_my_event_class( $classes, $event_id ){
$now = new DateTime( 'now', eo_get_blog_timezone() );
$schedule_start = eo_get_schedule_start( DATETIMEOBJ )
if( $schedule_start < $now ){
$classes[] = 'my-custom-class';
}
return $classes;
}
Alternatively you can also set the events colour directly (it expects a hexadecimal colour value, e.g. #FF0000)
add_filter( 'eventorganiser_event_color', 'set_event_color', 10, 2 );
function set_event_color( $color, $event_id ){
$now = new DateTime( 'now', eo_get_blog_timezone() );
$schedule_start = eo_get_schedule_start( DATETIMEOBJ )
if( $schedule_start < $now ){
//Change $color;
}
return $color;
}