I figured out that the numbers of dates is hardcoded in the sql query in the file, event-organiser-ajax.php and the function eventorganiser_widget_agenda. I changed the LIMIT from 4 to 5 to and reset the first date displayed to be the Monday closest to the current date.
However, when I click the next button to look at the next 5, nothing happens. So, clearly, I broke something. Any clue to help me reduce my wheel-spinning time?
Thanks.
function eventorganiser_widget_agenda() {
/*. . . */
$query['order'] = ($query['direction'] <1? 'DESC' : 'ASC');
$query['quantity'] = 5; /* suggested code */
$key = 'eo_ag_'.md5(serialize($query)).get_locale();
$agenda = get_transient('eo_widget_agenda');
if( $agenda && is_array($agenda) && isset($agenda[$key]) ){
echo json_encode($agenda[$key]);
exit;
}
if( 'day' == $query['mode'] ){
//Day mode
$week_start_day = (int) get_option('start_of_week'); /* suggested code */
$event_day = (int) $today->format('w'); /* suggested code */
$week_start_date = $today->modify('- '.$event_day.' days'); /* suggested code */
$selectDates="SELECT DISTINCT StartDate FROM {$wpdb->eo_events}";
$whereDates = " WHERE {$wpdb->eo_events}.StartDate".( $query['order']=='ASC' ? " >= " : " <= ")."%s ";
$whereDates .= " AND {$wpdb->eo_events}.StartDate >= %s ";
$orderlimit = "ORDER BY {$wpdb->eo_events}.StartDate {$query['order']} LIMIT ".$query['quantity']; /* suggested code */
$dates = $wpdb->get_col($wpdb->prepare($selectDates.$whereDates.$orderlimit, $week_start_date, $week_start_date->format('Y-m-d'))); /* suggested code */
/*. . . */
}
}