The close() method can be called on a DayPilot.Modal instance or as a static method.
If you call it on an instance it will close the specified modal dialog:
var modal = new DayPilot.Modal(); modal.showHtml("Hi"); // ... modal.close();
You can also call it as a static method from inside of a modal dialog that uses showUrl() to display a custom page. In that case it will close the last instance:
var modal1 = new DayPilot.Modal(); modal1.showUrl("/page/edit");