minor code update

This commit is contained in:
tibbi 2019-06-27 22:58:15 +02:00
parent 683821f8a8
commit 3263b60dee
2 changed files with 1 additions and 1 deletions

View File

@ -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

View File

@ -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