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 5ae8c0bc6..2dad7c923 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 @@ -420,7 +420,6 @@ class WeekFragment : Fragment(), WeeklyCalendar { return } - //Check if End time for event is start time for another day val isStartTimeDay = Formatter.getDateTimeFromTS(maxTS) == Formatter.getDateTimeFromTS(maxTS).withTimeAtStartOfDay() val numDays = Days.daysBetween(Formatter.getDateTimeFromTS(minTS).toLocalDate(), Formatter.getDateTimeFromTS(maxTS).toLocalDate()).days val daysCnt = if (numDays == 1 && isStartTimeDay) 0 else numDays diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/views/MonthView.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/views/MonthView.kt index 7cb83648e..ddf7dffa6 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/views/MonthView.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/views/MonthView.kt @@ -337,6 +337,7 @@ class MonthView(context: Context, attrs: AttributeSet, defStyle: Int) : View(con if (diff < 0) { eventStartDateTime = screenStartDateTime } + val isMidnight = Formatter.getDateTimeFromTS(endDateTime.seconds()) == Formatter.getDateTimeFromTS(endDateTime.seconds()).withTimeAtStartOfDay() val numDays = Days.daysBetween(eventStartDateTime, eventEndDateTime).days val daysCnt = if (numDays == 1 && isMidnight) 0 else numDays