[Plugin: All-in-One Event Calendar] FIX: Multi-day events only display once in Month view
-
I encountered the bug yesterday where a multi-day event will only show on the first day in the Calendar Month view.
After spending an hour understanding how the insides of the plugin works, I found a fix for it:
File:
/app/helpers/class-ai1ec-calendar-helper.php
Function:get_events_for_month
Lines:85-90
Replace
// Itemize events that fall under the current day foreach( $month_events as $event ) { $event_start = $ai1ec_events_helper->gmt_to_local( $event->start ); if( $event_start >= $start_time && $event_start < $end_time ) $_events[] = $event; }
With
// Itemize events that fall under the current day foreach( $month_events as $event ) { $event_start = $ai1ec_events_helper->gmt_to_local( $event->start ); $event_end = $ai1ec_events_helper->gmt_to_local( $event->end ); if( $event_end > $start_time && $event_start < $end_time ) $_events[] = $event; }
Explanation:
// ----- BEFORE ----- // // IF the Event starts after the start of the day [A] // AND the Event starts before the end of the day [B] // A B // |-------------------------| |----------------------| if( $event_start >= $start_time && $event_start < $end_time ) // ----- AFTER ----- // // IF the Event starts before the end of the day [B] // AND the Event ends after the start of the day [A] // A B // |----------------------| |----------------------| if( $event_end > $start_time && $event_start < $end_time )
Hope it helps!
http://wordpress.org/extend/plugins/all-in-one-event-calendar/
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘[Plugin: All-in-One Event Calendar] FIX: Multi-day events only display once in Month view’ is closed to new replies.