Fixes these issues:
- When choosing `Update/Delete this and all future occurrences`, the selected occurrence is never deleted/updated.
- When choosing `Update this and all future occurrences`, the event is duplicated on the date of the selection
The bug:
- Create a recurring event with a specific number of occurrences like 10 that starts on Jan 1
- Edit some occurrence e.g. 5th and select "Update this and future occurrences only"
- The edited event (5th) keeps repeating 10 times instead of ending on the end date of the original event (10th Jan). This is not consistent with other calendars (except nextcloud).
The fix:
Count the occurrence number starting from the first event and subtract it from the total number of repetitions before saving the event
Closes https://github.com/SimpleMobileTools/Simple-Calendar/issues/735
This only happened with all-day recurring events because:
- `ORIGINAL_INSTANCE_TIME` was not set to a UTC occurrence timestamp and and all-day events always deal in UTC.
- The `DTSTART`, `DTEND` were set to invalid values because of a missing conversion to milliseconds of start, end timestamps
Previously, if an event was modified using some other client then the exception event's parent id was ignored or overwritten with 0 at sync and that means the parent and child events were disconnected locally. Deleting the parent event did not delete the child event.
If a recurrence was modified using Simple Calendar then it was disconnected from it's parent event both locally and on the server because `ORIGINAL_ID` and `ORIGINAL_INSTANCE_TIME` was not specified. On top of that, another exception event was created to make sure the parent event doesn't show up on the date of the disconnected child event.
This change fixes these two issues.
Closes https://github.com/SimpleMobileTools/Simple-Calendar/issues/981
The events were moved forward because the start and end timestamps from the repeating occurrence were saved instead of the original start and end times.
The call to `eventsHelper.addEventRepeatLimit()` was removed because I believe it was added there by mistake and the changes were overwritten anyways due to the next call to `eventsHelper.updateEvent()`. Another reason to remove it is to avoid triggering a CalDAV update which may interfere with the event update.