From 97e5489f0f30025fae9e1b0ee512a8ecf3988a88 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 23 Apr 2017 19:15:30 +0200 Subject: [PATCH] fix displaying repeating events x times --- .../com/simplemobiletools/calendar/helpers/DBHelper.kt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/helpers/DBHelper.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/helpers/DBHelper.kt index 5485d7b3b..0afc08936 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/helpers/DBHelper.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/helpers/DBHelper.kt @@ -404,8 +404,10 @@ class DBHelper private constructor(val context: Context) : SQLiteOpenHelper(cont } } else { // events repeating x times - while (it.startTS < toTS && it.repeatLimit < 0) { - newEvents.add(it.copy()) + while (it.repeatLimit < 0) { + if (it.startTS >= fromTS && it.startTS < toTS) { + newEvents.add(it.copy()) + } it.addIntervalTime() it.repeatLimit++ }