diff --git a/calendar/inc/class.uiviews.inc.php b/calendar/inc/class.uiviews.inc.php index 515e9ee52d..96b26478b9 100644 --- a/calendar/inc/class.uiviews.inc.php +++ b/calendar/inc/class.uiviews.inc.php @@ -1848,7 +1848,9 @@ class uiviews extends uical } else { - $day_percentage = ($time_of_day-$this->wd_start) / ($this->wd_end - $this->wd_start); // between 0 and 1 + $wd_lenght = $this->wd_end - $this->wd_start; + if ($wd_lenght <= 0) $wd_lenght = 24*60; + $day_percentage = ($time_of_day-$this->wd_start) / $wd_lenght; // between 0 and 1 } $days = ($end - $start) / DAY_s; $percent += $day_percentage / $days;