I am using the event type for music festivals and local events, and the times are causing an annoyance on my calendar, as seen here: http://massivesound.us/event

I would prefer a block for the event not be shown on the following day when the event ends before some time (say 10am), but I don't know how to add that filter to the calendar views. How should I limit overnight events to have only one block on the calendar, on the the start date? I would like to do this for the week and month calendars.

Comments

Blitter’s picture

A robust solution would be in modifying the following line:

$result = db_query(db_rewrite_sql('SELECT n.nid, e.event_start FROM {node} n INNER JOIN {event} e ON n.nid = e.nid WHERE n.status = 1 AND ((e.event_start >= %d AND e.event_start <= %d) OR (e.event_end >= %d AND e.event_end <= %d) OR (e.event_start <= %d AND e.event_end >= %d)) ORDER BY event_start '), $first, $last, $first, $last, $first, $last); 

Such that events starting before today and finishing today before a certain time (say 9am) were not passed. A rough guess at the replacement line would be:

$early_end=  _event_mktime(9, 0, 0, $month, $day, $year);
$result = db_query(db_rewrite_sql('SELECT n.nid, e.event_start FROM {node} n INNER JOIN {event} e ON n.nid = e.nid WHERE n.status = 1 AND ((e.event_start >= %d AND e.event_start <= %d) OR (e.event_end >= %d AND e.event_end <= %d) OR (e.event_start <= %d AND e.event_end >= %d)) ORDER BY event_start '), $first, $last, $first, $last, $first, $early_end);