From acff39740e9416178c128a30723c8a240dd2b4cd Mon Sep 17 00:00:00 2001 From: Naveen Date: Sat, 24 Jun 2023 16:04:10 +0530 Subject: [PATCH] Properly count occurrences --- .../calendar/pro/activities/EventActivity.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/activities/EventActivity.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/activities/EventActivity.kt index 19d7668a1..286600d38 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/activities/EventActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/activities/EventActivity.kt @@ -1381,8 +1381,8 @@ class EventActivity : SimpleActivity() { val hasFixedRepeatCount = originalEvent.repeatLimit < 0 && mEvent.repeatLimit < 0 val repeatLimitUnchanged = originalEvent.repeatLimit == mEvent.repeatLimit if (hasFixedRepeatCount && repeatLimitUnchanged) { - val daysSinceStart = (mEventOccurrenceTS - originalEvent.startTS) / DAY - val newRepeatLimit = mEvent.repeatLimit + daysSinceStart + val occurrencesSinceStart = (mEventOccurrenceTS - originalEvent.startTS) / originalEvent.repeatInterval + val newRepeatLimit = mEvent.repeatLimit + occurrencesSinceStart mEvent.repeatLimit = newRepeatLimit }