From cd9ecdf0199e44df4a35abb3513e9299869f58b4 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Sun, 29 Oct 2006 12:51:53 +0000 Subject: [PATCH] daylight saving fix for today from Christian --- calendar/inc/class.uiviews.inc.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/calendar/inc/class.uiviews.inc.php b/calendar/inc/class.uiviews.inc.php index 7ccea49313..ddf41cdf72 100644 --- a/calendar/inc/class.uiviews.inc.php +++ b/calendar/inc/class.uiviews.inc.php @@ -815,7 +815,13 @@ class uiviews extends uical if ($this->debug > 1 || $this->debug==='dayColWidget') $this->bo->debug_message('uiviews::dayColWidget(%1,%2,left=%3,width=%4,)',False,$day_ymd,$events,$left,$width); $day_start = $this->bo->date2ts((string)$day_ymd); - + + // if daylight saving is switched on or off, correct $day_start + // gives correct times after 2am, times between 0am and 2am are wrong + if(($daylight_diff = $day_start + 12*HOUR_s - ($this->bo->date2ts($day_ymd."T120000")))) + { + $day_start -= $daylight_diff; + } // sorting the event into columns with none-overlapping events, the events are already sorted by start-time $eventCols = $col_ends = array(); foreach($events as $event)