add repeatable event if UNTIL is the time of last occurences start
This commit is contained in:
parent
c18bd90f21
commit
1957320bc8
1 changed files with 7 additions and 7 deletions
|
@ -387,14 +387,14 @@ class DBHelper private constructor(val context: Context) : SQLiteOpenHelper(cont
|
||||||
// get repeatable events
|
// get repeatable events
|
||||||
val selection = "$COL_REPEAT_INTERVAL != 0 AND $COL_START_TS < $toTS"
|
val selection = "$COL_REPEAT_INTERVAL != 0 AND $COL_START_TS < $toTS"
|
||||||
val events = getEvents(selection)
|
val events = getEvents(selection)
|
||||||
for (e in events) {
|
for (event in events) {
|
||||||
while (e.startTS < toTS && (e.repeatLimit == 0 || e.repeatLimit > e.endTS)) {
|
while (event.startTS < toTS && (event.repeatLimit == 0 || event.repeatLimit >= event.startTS)) {
|
||||||
if (e.startTS >= fromTS) {
|
if (event.startTS >= fromTS) {
|
||||||
newEvents.add(e.copy())
|
newEvents.add(event.copy())
|
||||||
} else if (getRunningEvents && (e.startTS <= fromTS && e.endTS >= toTS)) {
|
} else if (getRunningEvents && (event.startTS <= fromTS && event.endTS >= toTS)) {
|
||||||
newEvents.add(e.copy())
|
newEvents.add(event.copy())
|
||||||
}
|
}
|
||||||
e.addIntervalTime()
|
event.addIntervalTime()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue