You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Setting "minHour" or "maxHour" to other values than 0 and 24 will cause the partially out of range events to disappear (depends on the duration of the event)
To Reproduce
See the attached video
device-2022-03-22-104351.mp4
Expected behavior
The events should still be shown, even partially (same as the multi day events in the basic sample)
Additional context
Android version: [Android 11.0]
WeekView version: [5.3.2] & [latest "main" branch commit as of [22/02/2022]
The text was updated successfully, but these errors were encountered:
I'm trying to fix this myself by modifying the library's codes, could you tell me what is the code responsible for drawing the event chips so I can investigate there?
Update, I improved the code to cover more edge cases:
internal fun isWithin(
minHour: Int,
maxHour: Int
): Boolean {
val startTimeIsInRange = startTime.hour in minHour..maxHour
val endTimeIsInRange = endTime.hour in minHour..maxHour
val eventHoursStartBeforeAndEndAfterLimits = (startTime.hour..endTime.hour intersect minHour..maxHour).isNotEmpty()
val eventIsMultiDay = endTime.toEpochDays() - startTime.toEpochDays() > 0
return startTimeIsInRange || endTimeIsInRange || eventHoursStartBeforeAndEndAfterLimits || eventIsMultiDay
}
Please be careful with eventIsMultiDay, as it accepts all events that span across multiple days, even if they don't intersect with minHour and maxHour.
Describe the bug
Setting "minHour" or "maxHour" to other values than 0 and 24 will cause the partially out of range events to disappear (depends on the duration of the event)
To Reproduce
See the attached video
device-2022-03-22-104351.mp4
Expected behavior
The events should still be shown, even partially (same as the multi day events in the basic sample)
Additional context
The text was updated successfully, but these errors were encountered: