search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

Clear all the events from the calendar with javascript

Asked by Philippe
8 years ago.

Hi,

how to clear all the events from the calendar with javascript ?
Not remove the events form data base, but just clear the calendar for display.
I tried :
__________________
dpc1.events = [];
dpc1.update();
__________________
or
__________________
dpc1.events.splice(0, calendar.events.length);
dpc1.update();
__________________
but it doesn't works.
Any suggestion ?

Answer posted by Dan Letecky [DayPilot]
8 years ago.

Hi Philippe,

The events are stored in .events.list array - so you can do something like this:

dpc1.events.list = [];
dpc1.update();

See also:
https://api.daypilot.org/daypilot-calendar-events-list/

Comment posted by Philippe
8 years ago.

I was close but I didn't saw the good property.
And without DayPilot auto-completion...
Thank you.

This question is more than 1 months old and has been closed. Please create a new question if you have anything to add.