The opener() method returns the corresponding DayPilot.Modal instance from within the modal dialog.
DayPilot.Modal.opener()Returns a DayPilot.Modal object.
Call this method from code running inside the modal dialog when you need access to the current DayPilot.Modal instance.
const modal = DayPilot.Modal.opener();
if (modal) {
console.log(modal);
}