diff --git a/chrono/manager/views.py b/chrono/manager/views.py index b095f9ed..f9cdbe68 100644 --- a/chrono/manager/views.py +++ b/chrono/manager/views.py @@ -1510,7 +1510,11 @@ class AgendaDayView(AgendaDateView, DayArchiveView): context['hours'] = [datetime.time(hour=i) for i in range(start_time.hour, end_time.hour)] def get_time_ratio(t1, t2): - return 100 * ((t1.hour - t2.hour) * 60 + t1.minute - t2.minute) // 60 + return ( + 100 + * ((t1.hour - t2.hour) * 60 + t1.minute - t2.minute) + // (end_time.hour * 60 + end_time.minute - (start_time.hour * 60 + start_time.minute)) + ) bookings = Booking.objects.filter(event__in=events) bookings_by_user = collections.defaultdict(list)