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) {
val dayCode = Formatter.getDayCodeFromTS(fromTS)
val endDayCode = Formatter.getDayCodeFromTS(event.endTS)
if (dayCode == endDayCode) {
events.add(event.copy())
if (event.repeatInterval.isXWeeklyRepetition()) {
if (event.startTS.isTsOnProperDay(event)) {
if (isOnProperWeek(event, startTimes)) {
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)