From d3555a2ff5c3661bb3608832069e5e5379203606 Mon Sep 17 00:00:00 2001 From: defacer Date: Mon, 23 May 2005 13:53:06 +0000 Subject: [PATCH] A small bugfix/update to work with DST. Before, events starting between 00:00 and 00:59 in the first day of each month were not shown at all with DST on. --- calendar/lib.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/calendar/lib.php b/calendar/lib.php index 2aaa4c5d197..fb1e4017f52 100644 --- a/calendar/lib.php +++ b/calendar/lib.php @@ -115,8 +115,10 @@ function calendar_get_mini($courses, $groups, $users, $cal_month = false, $cal_y } // Get the events matching our criteria. Don't forget to offset the timestamps for the user's TZ! - // TODO: usertime() doesn't compensate for DST. Thus the line below is wrong. - $whereclause = calendar_sql_where(usertime($display->tstart), usertime($display->tend), $users, $groups, $courses); + $whereclause = calendar_sql_where( + usertime($display->tstart) - dst_offset_on($display->tstart), + usertime($display->tend) - dst_offset_on($display->tend), + $users, $groups, $courses); if($whereclause === false) { $events = array();