The dispose() method destroys the JavaScript Calendar component, removes the content of the placeholder element, and performs cleanup.
DayPilot.Calendar.dispose()This method has no parameters.
After calling dispose(), the DayPilot.Calendar object becomes unusable.
const calendar = new DayPilot.Calendar("dp");
calendar.init();
// ...
calendar.dispose();