Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sync calendars #124

Closed
strukturart opened this issue Jul 4, 2022 · 2 comments
Closed

sync calendars #124

strukturart opened this issue Jul 4, 2022 · 2 comments

Comments

@strukturart
Copy link

is the local calendar synchronized with the remote calendar with https://tsdav.vercel.app/docs/caldav/syncCalendars or are the calendar data compared and the differences returned?

@natelindev
Copy link
Owner

It will just return the latest content of the provided list of oldCalendars provided.
like if you use syncCalendars({ oldCalendars: [cal1, cal2], ... })
it will return [cal1, cal2] with latests content.

if detailedResult param is true and you also provided the list of objects array for those calendars, the function will do the diff for you and return an object like:

{
   created: [cal3],
   updated: [cal2],
   deleted: [cal1],
}

Then you can

  1. create cal3 in your local, use fetchCalendarObjects to fetch the objects and fill them in.
  2. use smartCollectionSync and specify: calendarMultiGet function and detailedResult as true to get the { created: ..., updated: ..., deleted: ...} content of cal2 calendar objects and update your local accrodingly.
  3. delete cal1 from your local.

@strukturart
Copy link
Author

Thanks for your explanation, now I understand. thanks for tsdav it is very helpful and easy to use.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants