mirror of
https://github.com/SimpleMobileTools/Simple-Calendar.git
synced 2025-04-24 22:58:42 +02:00
some fixes to weekly repeating events repeating x times
This commit is contained in:
parent
97e5489f0f
commit
0a24dcbc31
@ -404,7 +404,16 @@ class DBHelper private constructor(val context: Context) : SQLiteOpenHelper(cont
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// events repeating x times
|
// events repeating x times
|
||||||
while (it.repeatLimit < 0) {
|
while (it.repeatLimit < 0 && it.endTS < toTS) {
|
||||||
|
if (it.repeatInterval != 0 && it.repeatInterval % WEEK == 0) {
|
||||||
|
if (it.startTS >= fromTS && it.startTS < toTS) {
|
||||||
|
if (it.startTS.isTsOnValidDay(it)) {
|
||||||
|
newEvents.add(it.copy())
|
||||||
|
it.repeatLimit++
|
||||||
|
}
|
||||||
|
}
|
||||||
|
it.addIntervalTime()
|
||||||
|
} else {
|
||||||
if (it.startTS >= fromTS && it.startTS < toTS) {
|
if (it.startTS >= fromTS && it.startTS < toTS) {
|
||||||
newEvents.add(it.copy())
|
newEvents.add(it.copy())
|
||||||
}
|
}
|
||||||
@ -413,8 +422,9 @@ class DBHelper private constructor(val context: Context) : SQLiteOpenHelper(cont
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// check if weekly repeatable events are on the current day
|
// check if weekly repeatable events are on the correct day
|
||||||
val filteredEvents = ArrayList<Event>(newEvents.size)
|
val filteredEvents = ArrayList<Event>(newEvents.size)
|
||||||
newEvents.forEach {
|
newEvents.forEach {
|
||||||
if (it.repeatInterval != 0 && it.repeatInterval % WEEK == 0) {
|
if (it.repeatInterval != 0 && it.repeatInterval % WEEK == 0) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user