Meeting Conflict Detection Tool
Add New Meeting
Entered Meetings
- No meetings added yet.
Input meetings on the first tab and click "Detect Conflicts & View Report".
Conflict Report
'; if (conflictGroups.length > 0) { reportHTML += `${conflictGroups.length} conflict group(s) found:
`; conflictGroups.forEach((group, index) => { reportHTML += `Conflict Group ${index + 1}
`; group.sort((a,b) => a.startDateTime - b.startDateTime).forEach(m => { // Sort meetings within group for display reportHTML += `${mcdtFormatMeetingForDisplay(m)}
`;
});
reportHTML += `No conflicts detected among the entered meetings.
`; } reportHTML += `Non-Conflicting Meetings
`; const nonConflictingMeetings = mcdtMeetings.filter(m => !meetingsInvolvedInConflict.has(m.id)); if (nonConflictingMeetings.length > 0) { reportHTML += `- `;
nonConflictingMeetings.sort((a,b) => a.startDateTime - b.startDateTime).forEach(m => {
reportHTML += `
- ${mcdtFormatMeetingForDisplay(m)} `; }); reportHTML += `
All entered meetings are involved in conflicts.
`; } else if (conflictGroups.length === 0 && mcdtMeetings.length > 0) { // This case is handled by "No conflicts detected" above. } else { reportHTML += `No meetings to list or all were involved in conflicts.
`; } reportHTML += `Meeting Conflict Report
`; pdfHTML += `All Entered Meetings (${mcdtMeetings.length})
`; if (mcdtMeetings.length > 0) { pdfHTML += `| Name | Date | Start Time | End Time |
|---|---|---|---|
| ${m.name} | ${m.date} | ${m.startTime} | ${m.endTime} |
No meetings were entered.
"; } // Add the generated conflict report (which contains conflict groups and non-conflicting sections) pdfHTML += reportDisplayElement.innerHTML; const pdfContainer = document.getElementById('mcdt-report-content-for-pdf'); if(!pdfContainer) return; pdfContainer.innerHTML = pdfHTML; const opt = { margin: [0.5, 0.4, 0.5, 0.4], filename: 'Meeting_Conflict_Report.pdf', image: { type: 'jpeg', quality: 0.98 }, html2canvas: { scale: 2, useCORS: true, logging: false }, jsPDF: { unit: 'in', format: 'letter', orientation: 'portrait' }, pagebreak: { mode: ['avoid-all', 'css', 'legacy'] } }; html2pdf().from(pdfContainer).set(opt).save().then(() => { pdfContainer.innerHTML = ''; }).catch(err => { console.error("Error generating PDF:", err); pdfContainer.innerHTML = ''; alert("An error occurred while generating the PDF. Check console for details."); }); }