Productivity Meeting Planner

Productivity Meeting Planner

Step 1: Define Meeting Details

Time: ${time || 'Not set'}

Attendees: ${attendees || 'Not set'}


Agenda

${agendaHtml}
Total Estimated Time ${totalDuration} min
`; }; /** * Generates and downloads a professional PDF of the meeting agenda. */ const downloadPDF = () => { const { jsPDF } = window.jspdf; const doc = new jsPDF(); const title = document.getElementById('meetingTitle').value; const date = document.getElementById('meetingDate').value; const time = document.getElementById('meetingTime').value; const attendees = document.getElementById('meetingAttendees').value; let totalDuration = 0; doc.setFontSize(22); doc.text(title, 14, 22); doc.setFontSize(12); doc.text(`Date: ${date}`, 14, 32); doc.text(`Time: ${time}`, 14, 38); const splitAttendees = doc.splitTextToSize(`Attendees: ${attendees}`, 180); doc.text(splitAttendees, 14, 46); const tableBody = agendaItems.map(item => { totalDuration += item.duration; return [item.topic, `${item.duration} min`]; }); tableBody.push(['Total Estimated Time', `${totalDuration} min`]); doc.autoTable({ startY: 50 + (splitAttendees.length * 5), head: [['Topic', 'Duration']], body: tableBody, theme: 'grid', headStyles: { fillColor: [59, 130, 246] }, foot: [['Total Estimated Time', `${totalDuration} min`]], footStyles: { fontStyle: 'bold' } }); doc.save(`${title.replace(/\s+/g, '_')}_Agenda.pdf`); }; // --- Event Listeners --- prevBtn.addEventListener('click', () => changeTab(currentTab - 1)); nextBtn.addEventListener('click', () => changeTab(currentTab + 1)); pdfDownloadBtn.addEventListener('click', downloadPDF); addAgendaItemBtn.addEventListener('click', () => { agendaItems.push({ topic: "", duration: 10, presenter: "" }); renderAgendaBuilder(); }); agendaItemsContainer.addEventListener('click', (e) => { if (e.target.classList.contains('remove-item-btn')) { const index = parseInt(e.target.dataset.index); agendaItems.splice(index, 1); renderAgendaBuilder(); } }); // --- Initial Setup --- const initializeTool = () => { document.getElementById('meetingDate').valueAsDate = new Date(); document.getElementById('meetingTime').value = new Date().toTimeString().substring(0,5); renderAgendaBuilder(); updateNavButtons(); }; initializeTool(); });
Scroll to Top