Skip to content
Snippets Groups Projects
Commit 454aecd4 authored by Karen Stevenson's avatar Karen Stevenson
Browse files

#310893 Permormance improvements for ical feed, patch by mcorner.

parent 788eb2ac
No related branches found
No related tags found
No related merge requests found
......@@ -4,6 +4,7 @@ Views Calendar 5.x
Version 5.2 dev
===============
- #310893 Permormance improvements for ical feed.
- #312418 Fix all_day event marker in ical import.
- #312407 Fix title of Week view.
- #324480 Rename calendar blocks so they show up together in block list.
......
......@@ -59,14 +59,20 @@ function calendar_ical_calendar_add_items($view) {
$items = array();
$feeds = calendar_ical_add_feeds($view);
$min = date_format($view->min_date, DATE_FORMAT_DATETIME);
$max = date_format($view->max_date, DATE_FORMAT_DATETIME);
foreach ($feeds as $feed) {
if (!empty($feed->calendar_start) && !empty($feed->calendar_end)) {
if ($feed->calendar_start >= date_format($view->min_date, DATE_FORMAT_DATETIME) && $feed->calendar_end <= date_format($view->max_date, DATE_FORMAT_DATETIME)) {
// We have to add a calendar start and end object to the feed,
// the cached date objects will not work correctly.
$feed->calendar_start_date = date_make_date($feed->calendar_start, $feed->timezone);
$feed->calendar_end_date = date_make_date($feed->calendar_end, $feed->timezone);
$items[] = $feed;
if (($feed->calendar_start >= $min && $feed->calendar_end <= $max) || ($feed->calendar_start >= $min && $feed->all_day == 1)){
// We have to add a calendar start and end object to the feed,
// the cached date objects will not work correctly.
$feed->calendar_start_date = date_make_date($feed->calendar_start, $feed->timezone);
$feed->calendar_end_date = date_make_date($feed->calendar_end, $feed->timezone);
$items[] = $feed;
}
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment