From fcd43841ea9ad473348c386b9c6202948534a02b Mon Sep 17 00:00:00 2001 From: Jason Oster Date: Thu, 15 Apr 2010 20:36:14 +0000 Subject: Fix overlapping events, Bug #2968512 --- functions/draw_functions.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'functions/draw_functions.php') diff --git a/functions/draw_functions.php b/functions/draw_functions.php index 836d41f..c20e04c 100644 --- a/functions/draw_functions.php +++ b/functions/draw_functions.php @@ -31,7 +31,12 @@ function drawEventTimes ($start, $end, $long_event = FALSE) { $end_min = "00"; } } - $draw_len = ($end_h * 60 + $end_min) - ($sta_h * 60 + $sta_min); + $sta = ($sta_h * 60 + $sta_min); + $end = ($end_h * 60 + $end_min); + if ($sta < $end) + $draw_len = $end - $sta; + else + $draw_len = $sta - $end; return array ("draw_start" => ($sta_h . $sta_min), "draw_end" => ($end_h . $end_min), "draw_length" => $draw_len); } -- cgit v1.2.3