From 1957320bc814cfec3aad2c5131eb6122ff358a00 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 9 Apr 2017 21:13:30 +0200 Subject: [PATCH] add repeatable event if UNTIL is the time of last occurences start --- .../simplemobiletools/calendar/helpers/DBHelper.kt | 14 +++++++------- 1 file changed, 7 insertions(+), 7 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 b11aa9ea3..3afbe13b0 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/helpers/DBHelper.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/helpers/DBHelper.kt @@ -387,14 +387,14 @@ class DBHelper private constructor(val context: Context) : SQLiteOpenHelper(cont // get repeatable events val selection = "$COL_REPEAT_INTERVAL != 0 AND $COL_START_TS < $toTS" val events = getEvents(selection) - for (e in events) { - while (e.startTS < toTS && (e.repeatLimit == 0 || e.repeatLimit > e.endTS)) { - if (e.startTS >= fromTS) { - newEvents.add(e.copy()) - } else if (getRunningEvents && (e.startTS <= fromTS && e.endTS >= toTS)) { - newEvents.add(e.copy()) + for (event in events) { + while (event.startTS < toTS && (event.repeatLimit == 0 || event.repeatLimit >= event.startTS)) { + if (event.startTS >= fromTS) { + newEvents.add(event.copy()) + } else if (getRunningEvents && (event.startTS <= fromTS && event.endTS >= toTS)) { + newEvents.add(event.copy()) } - e.addIntervalTime() + event.addIntervalTime() } }