From 3263b60dee56c24b3e3803809370b2d9d775092d Mon Sep 17 00:00:00 2001 From: tibbi Date: Thu, 27 Jun 2019 22:58:15 +0200 Subject: [PATCH] minor code update --- .../com/simplemobiletools/calendar/pro/fragments/WeekFragment.kt | 1 - .../kotlin/com/simplemobiletools/calendar/pro/views/MonthView.kt | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) 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