Merge pull request #1339 from Honk2/concurrent_events_in_weekview

fix #1332 concurrent zero duration in week view
This commit is contained in:
Tibor Kaputa 2021-07-05 22:55:34 +02:00 committed by GitHub
commit d4f741fa9f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -402,7 +402,7 @@ class WeekFragment : Fragment(), WeeklyCalendar {
if (!event.getIsAllDay() && Formatter.getDayCodeFromDateTime(startDateTime) == Formatter.getDayCodeFromDateTime(endDateTime)) { if (!event.getIsAllDay() && Formatter.getDayCodeFromDateTime(startDateTime) == Formatter.getDayCodeFromDateTime(endDateTime)) {
val startMinutes = startDateTime.minuteOfDay val startMinutes = startDateTime.minuteOfDay
val duration = endDateTime.minuteOfDay - startMinutes 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 eventWeekly = EventWeeklyView(event.id!!, range)
val dayCode = Formatter.getDayCodeFromDateTime(startDateTime) val dayCode = Formatter.getDayCodeFromDateTime(startDateTime)
@ -428,7 +428,7 @@ class WeekFragment : Fragment(), WeeklyCalendar {
val startMinutes = startDateTime.minuteOfDay val startMinutes = startDateTime.minuteOfDay
val duration = endDateTime.minuteOfDay - startMinutes val duration = endDateTime.minuteOfDay - startMinutes
val range = Range(startMinutes, startMinutes + duration) val range = Range(startMinutes, startMinutes + maxOf(1, duration))
var overlappingEvents = 0 var overlappingEvents = 0
var currentEventOverlapIndex = 0 var currentEventOverlapIndex = 0