simplify the checking of multiple-day events
This commit is contained in:
parent
8fa79dd441
commit
e2ed197e87
1 changed files with 2 additions and 2 deletions
|
@ -312,8 +312,8 @@ class WeekFragment : Fragment(), WeeklyCalendar {
|
||||||
val startDateTime = Formatter.getDateTimeFromTS(event.startTS)
|
val startDateTime = Formatter.getDateTimeFromTS(event.startTS)
|
||||||
val endDateTime = Formatter.getDateTimeFromTS(event.endTS)
|
val endDateTime = Formatter.getDateTimeFromTS(event.endTS)
|
||||||
|
|
||||||
val minTS = Math.max(startDateTime.withTimeAtStartOfDay().seconds(), mWeekTimestamp)
|
val minTS = Math.max(startDateTime.seconds(), mWeekTimestamp)
|
||||||
val maxTS = Math.min(endDateTime.withTimeAtStartOfDay().seconds(), mWeekTimestamp + WEEK_SECONDS)
|
val maxTS = Math.min(endDateTime.seconds(), mWeekTimestamp + WEEK_SECONDS)
|
||||||
val startDateTimeInWeek = Formatter.getDateTimeFromTS(minTS)
|
val startDateTimeInWeek = Formatter.getDateTimeFromTS(minTS)
|
||||||
val firstDayIndex = (startDateTimeInWeek.dayOfWeek - if (context.config.isSundayFirst) 0 else 1) % 7
|
val firstDayIndex = (startDateTimeInWeek.dayOfWeek - if (context.config.isSundayFirst) 0 else 1) % 7
|
||||||
val daysCnt = Days.daysBetween(Formatter.getDateTimeFromTS(minTS), Formatter.getDateTimeFromTS(maxTS)).days
|
val daysCnt = Days.daysBetween(Formatter.getDateTimeFromTS(minTS), Formatter.getDateTimeFromTS(maxTS)).days
|
||||||
|
|
Loading…
Reference in a new issue