You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
constdav=require('dav');varxhr=newdav.transport.Basic(newdav.Credentials({username: '****USER****',password: '****PASSWORD****'}));varclient=newdav.Client(xhr);client.createAccount({server: '****SERVER URL****',accountType: 'caldav',loadObjects: true}).then((account)=>{constcalendar=account.calendars[0];// get all events from calendarcalendar.objects.forEach((calendarObject)=>{// remove current event from calendarclient.deleteCalendarObject(calendarObject,{xhr: xhr});});});
to remove all objects of a calendar, but unfortunately it does not work properly, im always getting this error:
(node:7783) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 335)
(node:7783) UnhandledPromiseRejectionWarning: Error: Bad status: 412
Maybe anyone here can help me :)
Thanks, Mike
The text was updated successfully, but these errors were encountered:
Hey!
Is there a way to reset / clear a calendar?
I tried to run this code:
to remove all objects of a calendar, but unfortunately it does not work properly, im always getting this error:
Maybe anyone here can help me :)
Thanks, Mike
The text was updated successfully, but these errors were encountered: