Very strange, since the function seems to be defined.
One thing to check is the context from which you call the .close() method.
To close the modal dialog from the parent simply call .close() on the instance:
var modal = new DayPilot.Modal();
//...
modal.close()
To close it from within the modal page there are two options:
1. The older method which accesses the parent window (pre-2.2 versions):
if (parent && parent.DayPilot && parent.DayPilot.ModalStatic) {
parent.DayPilot.ModalStatic.close();
}
2. Since 2.2 you can simply call:
DayPilot.Modal.close(result);
In this case you need to include modal.js in the modal page (otherwise it won't be able to access DayPilot.Modal object).
Let me know if it didn't help.