diff options
Diffstat (limited to 'functions/draw_functions.php')
-rw-r--r-- | functions/draw_functions.php | 7 |
1 files changed, 6 insertions, 1 deletions
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); } |