From d5f5fdb214c6ddaa09641679c59b120757faba4b Mon Sep 17 00:00:00 2001 From: Honk2 Date: Sat, 10 Apr 2021 12:09:36 +0200 Subject: [PATCH] concurrent zero duration in week view --- .../simplemobiletools/calendar/pro/fragments/WeekFragment.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/fragments/WeekFragment.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/fragments/WeekFragment.kt index adfc76663..011b03ecc 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/fragments/WeekFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/fragments/WeekFragment.kt @@ -402,7 +402,7 @@ class WeekFragment : Fragment(), WeeklyCalendar { if (!event.getIsAllDay() && Formatter.getDayCodeFromDateTime(startDateTime) == Formatter.getDayCodeFromDateTime(endDateTime)) { val startMinutes = startDateTime.minuteOfDay val duration = endDateTime.minuteOfDay - startMinutes - val range = Range(startMinutes, startMinutes + duration) + val range = Range(startMinutes, startMinutes + maxOf(1,duration)) val eventWeekly = EventWeeklyView(event.id!!, range) val dayCode = Formatter.getDayCodeFromDateTime(startDateTime) @@ -428,7 +428,7 @@ class WeekFragment : Fragment(), WeeklyCalendar { val startMinutes = startDateTime.minuteOfDay val duration = endDateTime.minuteOfDay - startMinutes - val range = Range(startMinutes, startMinutes + duration) + val range = Range(startMinutes, startMinutes + maxOf(1, duration)) var overlappingEvents = 0 var currentEventOverlapIndex = 0