mirror of
https://github.com/SimpleMobileTools/Simple-Calendar.git
synced 2025-06-05 21:59:17 +02:00
fix displaying of events repeating by x weeks
This commit is contained in:
@@ -392,7 +392,13 @@ class DBHelper private constructor(val context: Context) : SQLiteOpenHelper(cont
|
|||||||
if (it.startTS >= fromTS) {
|
if (it.startTS >= fromTS) {
|
||||||
if (it.repeatInterval % WEEK == 0) {
|
if (it.repeatInterval % WEEK == 0) {
|
||||||
if (it.startTS.isTsOnProperDay(it)) {
|
if (it.startTS.isTsOnProperDay(it)) {
|
||||||
newEvents.add(it.copy())
|
val initialWeekOfYear = Formatter.getDateTimeFromTS(startTimes[it.id]).weekOfWeekyear
|
||||||
|
val currentWeekOfYear = Formatter.getDateTimeFromTS(it.startTS).weekOfWeekyear
|
||||||
|
|
||||||
|
// check if its the proper week, for events repeating by x weeks
|
||||||
|
if ((currentWeekOfYear - initialWeekOfYear) % (it.repeatInterval / WEEK) == 0) {
|
||||||
|
newEvents.add(it.copy())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
newEvents.add(it.copy())
|
newEvents.add(it.copy())
|
||||||
|
Reference in New Issue
Block a user