Properly count occurrences
This commit is contained in:
parent
46e17aa697
commit
acff39740e
|
@ -1381,8 +1381,8 @@ class EventActivity : SimpleActivity() {
|
||||||
val hasFixedRepeatCount = originalEvent.repeatLimit < 0 && mEvent.repeatLimit < 0
|
val hasFixedRepeatCount = originalEvent.repeatLimit < 0 && mEvent.repeatLimit < 0
|
||||||
val repeatLimitUnchanged = originalEvent.repeatLimit == mEvent.repeatLimit
|
val repeatLimitUnchanged = originalEvent.repeatLimit == mEvent.repeatLimit
|
||||||
if (hasFixedRepeatCount && repeatLimitUnchanged) {
|
if (hasFixedRepeatCount && repeatLimitUnchanged) {
|
||||||
val daysSinceStart = (mEventOccurrenceTS - originalEvent.startTS) / DAY
|
val occurrencesSinceStart = (mEventOccurrenceTS - originalEvent.startTS) / originalEvent.repeatInterval
|
||||||
val newRepeatLimit = mEvent.repeatLimit + daysSinceStart
|
val newRepeatLimit = mEvent.repeatLimit + occurrencesSinceStart
|
||||||
mEvent.repeatLimit = newRepeatLimit
|
mEvent.repeatLimit = newRepeatLimit
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue