From e70f70f1480b34e4f2cc4bcabfa411359a5eaf44 Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Fri, 18 Feb 2011 16:09:42 +0000 Subject: [PATCH] Better handling for multi-day events - properly show up for each day of the week --- calendar/inc/class.calendar_merge.inc.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/calendar/inc/class.calendar_merge.inc.php b/calendar/inc/class.calendar_merge.inc.php index 92d274e4c4..8e1e2dfd13 100644 --- a/calendar/inc/class.calendar_merge.inc.php +++ b/calendar/inc/class.calendar_merge.inc.php @@ -82,6 +82,7 @@ class calendar_merge extends bo_merge } $this->query = $GLOBALS['egw']->session->appsession('session_data','calendar'); $this->query['users'] = explode(',', $this->query['owner']); + $this->query['num_rows'] = -1; } /** @@ -216,7 +217,14 @@ class calendar_merge extends bo_merge { foreach($list as $key => $event) { - $days[date('Ymd',$_date)][date('l',$event['start'])][] = $this->calendar_replacements($event); + $start = egw_time::to($event['start'], 'array'); + $end = egw_time::to($event['end'], 'array'); + if($start['year'] == $end['year'] && $start['month'] == $end['month'] && $start['day'] == $end['day']) { + $dow = date('l',$event['start']); + } else { + $dow = date('l', strtotime($day)); + } + $days[date('Ymd',$_date)][$dow][] = $this->calendar_replacements($event); } if(strpos($repeat, '$$day/date$$') !== false) { $date_marker = array('$$day/date$$' => date($GLOBALS['egw_info']['user']['preferences']['common']['dateformat'], strtotime($day)));