fix #185, properly display weekly all-day events

This commit is contained in:
tibbi 2017-07-04 21:09:30 +02:00
parent dadaec8eb9
commit bfc991ae6e
1 changed files with 12 additions and 4 deletions

View File

@ -495,10 +495,18 @@ class DBHelper private constructor(val context: Context) : SQLiteOpenHelper(cont
} }
if (event.isAllDay) { if (event.isAllDay) {
val dayCode = Formatter.getDayCodeFromTS(fromTS) if (event.repeatInterval.isXWeeklyRepetition()) {
val endDayCode = Formatter.getDayCodeFromTS(event.endTS) if (event.startTS.isTsOnProperDay(event)) {
if (dayCode == endDayCode) { if (isOnProperWeek(event, startTimes)) {
events.add(event.copy()) events.add(event.copy())
}
}
} else {
val dayCode = Formatter.getDayCodeFromTS(fromTS)
val endDayCode = Formatter.getDayCodeFromTS(event.endTS)
if (dayCode == endDayCode) {
events.add(event.copy())
}
} }
} }
event.addIntervalTime(original) event.addIntervalTime(original)