To make this work, I changed the line 668 in service/class-em-event.php to:
$filter_results[]= $event_dao->get_events_at_date($start_date,true);
And I have added this method to dao/class-em-event.php:
// Get events at a date
public function get_events_at_date($date, $format = false) {
$start_time = em_time($date);
$end_time = $start_time + 86340;
$event_ids = array();
$filter = array(
'orderby' => 'date',
'numberposts'=> -1,
'post_status'=> 'publish',
'order' => 'DESC',
'meta_query' => array(// WordPress has all the results, now, return only the events after today's date
'relation' => 'AND',
array(
'key' => em_append_meta_key('start_date'), // Check the start date field
'value' => $start_time, // Set today's date (note the similar format)
'compare' => '>=', // Return the ones greater than today's date
'type' => 'NUMERIC,' // Let WordPress know we're working with numbers
),
array(
'key' => em_append_meta_key('start_date'), // Check the start date field
'value' => $end_time, // Set today's date (note the similar format)
'compare' => '<=', // Return the ones greater than today's date
'type' => 'NUMERIC,' // Let WordPress know we're working with numbers
)
),
'post_type' => EM_EVENT_POST_TYPE);
$events = $this->get_events($filter);
if (!empty($events)):
foreach ($events as $event):
$event_ids[] = $event->ID;
endforeach;
endif;
$recurring_events= $this->get_recurring_events_by_date($date);
$event_ids= array_merge($event_ids,$recurring_events->ids);
return $event_ids;
}
-
This reply was modified 7 years, 5 months ago by Kasp.