Delete all Events within Daterange

hi there…

is it possible to delete all Events for a given date range, without iterating through scheduler.getEvents() ?

Please, see example:

yes… this will work… thank you!

Hey @Polina,

The snippet seems to be missing (to delete events in a date range). Do you have it available somewhere else? Was hoping to see if it would work for my use case.


Hello @markatfin,

You can delete events for a date range in two steps:

  1. Get events in a date range with the getEvents method:
    getEvents Scheduler Docs
  2. Loop through events that you got, and run the deleteEvent(id) :
    deleteEvent Scheduler Docs

method for each of them, like follows:

function deleteEvs(){
    var evs = scheduler.getEvents(new Date(2024, 5, 24),new Date(2024, 5, 30)); 
    for (var i=0; i<evs.length; i++){

Here is a demo(click the delete events button):

Kind regards,