From ccfe337f1ee9f554dc2ee2dc1416c508b93c35f7 Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Tue, 29 Mar 2011 15:10:55 +0000 Subject: [PATCH] Remove date from fancy date+time formatting for multi-day events, leave day-relative time --- calendar/inc/class.calendar_merge.inc.php | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/calendar/inc/class.calendar_merge.inc.php b/calendar/inc/class.calendar_merge.inc.php index 3a12bdbd55..b6ea5a1d51 100644 --- a/calendar/inc/class.calendar_merge.inc.php +++ b/calendar/inc/class.calendar_merge.inc.php @@ -232,10 +232,8 @@ class calendar_merge extends bo_merge } else { $dow = date('l', strtotime($day)); // Fancy date+time formatting for multi-day events - $start_time = date($time_format, $day == date('Ymd', $event['start']) ? $event['start'] : mktime(0,0,0,0,0,1)); - $end_time = date($time_format, $day == date('Ymd', $event['end']) ? $event['end'] : mktime(23,59,59,0,0,0)); - $replacements['$$calendar_starttime$$'] = date($GLOBALS['egw_info']['user']['preferences']['common']['dateformat'], strtotime($day)) . ' ' .$start_time; - $replacements['$$calendar_endtime$$'] = date($GLOBALS['egw_info']['user']['preferences']['common']['dateformat'], strtotime($day)) . ' ' . $end_time; + $replacements['$$calendar_starttime$$'] = date($time_format, $day == date('Ymd', $event['start']) ? $event['start'] : mktime(0,0,0,0,0,1)); + $replacements['$$calendar_endtime$$'] = date($time_format, $day == date('Ymd', $event['end']) ? $event['end'] : mktime(23,59,59,0,0,0)); } $days[date('Ymd',$_date)][$dow][] = $replacements; @@ -306,6 +304,7 @@ class calendar_merge extends bo_merge $replacements = array(); $days = array(); + $time_format = $GLOBALS['egw_info']['user']['preferences']['common']['timeformat'] == 12 ? 'h:i a' : 'H:i'; foreach($events as $day => $list) { foreach($list as $key => $event) @@ -317,10 +316,8 @@ class calendar_merge extends bo_merge $dow = date('l',$event['start']); } else { // Fancy date+time formatting for multi-day events - $start_time = date($time_format, $day == date('Ymd', $event['start']) ? $event['start'] : mktime(0,0,0,0,0,1)); - $end_time = date($time_format, $day == date('Ymd', $event['end']) ? $event['end'] : mktime(23,59,59,0,0,0)); - $replacements['$$calendar_starttime$$'] = date($GLOBALS['egw_info']['user']['preferences']['common']['dateformat'], strtotime($day)) . ' ' .$start_time; - $replacements['$$calendar_endtime$$'] = date($GLOBALS['egw_info']['user']['preferences']['common']['dateformat'], strtotime($day)) . ' ' . $end_time; + $replacements['$$calendar_starttime$$'] = date($time_format, $day == date('Ymd', $event['start']) ? $event['start'] : mktime(0,0,0,0,0,1)); + $replacements['$$calendar_endtime$$'] = date($time_format, $day == date('Ymd', $event['end']) ? $event['end'] : mktime(23,59,59,0,0,0)); } $days[date('Ymd',$_date)][$plugin][] = $replacements; }