EddyVerbruggen / Calendar-PhoneGap-Plugin

:date: Cordova plugin to Create, Change, Delete and Find Events in the native Calendar
773 stars 402 forks source link

batch transaction to create multiple events #544

Open Misch82 opened 3 years ago

Misch82 commented 3 years ago

Adding some functions to batch-process local calendar event inserts on Android The code is hacked at the moment, error/exceptions handling is a mess (not existing).

startBatchForCreateEvents starts a batch transaction cancelBatchForCreateEvents cancels a batch transaction commitBatchForCreateEvents commits a batch transaction

When a batch transaction has been created (with startBatchForCreateEvents), calling a create event function will add the event to the transaction.

This method saves a lot of processing time when creating a lot of events and also reduces the chance that something goes wrong (adding a lot of single events without batch transaction is not working very good)