Online Smart Calendar with Task Sync

Smart Calendar with Task Sync

This Week's Schedule

Set Your Availability & Tasks

Working Hours

Fixed Appointments

Tasks to Schedule

Generate Your Schedule

Click the button below to automatically schedule your tasks into your available time slots.

Schedule Generated!

${data.scheduledTasks.length} tasks scheduled.

`; if (unscheduledTasks.length > 0) { summary.innerHTML += `

Could not schedule:

    ${unscheduledTasks.map(d => `
  • ${d}
  • `).join('')}
`; } getElement('download-pdf-btn').disabled = false; }; const generatePDF = () => { const content = getElement('pdf-content'); if (!content) return; content.classList.add('pdf-mode'); html2canvas(content, { scale: 2, windowWidth: content.scrollWidth }).then(canvas => { content.classList.remove('pdf-mode'); const imgData = canvas.toDataURL('image/png'); const { jsPDF } = window.jspdf; const pdf = new jsPDF({ orientation: 'l', unit: 'mm', format: 'a4' }); const pdfWidth = pdf.internal.pageSize.getWidth(); const ratio = canvas.width / canvas.height; const pdfImgWidth = pdfWidth - 20; const pdfImgHeight = pdfImgWidth / ratio; pdf.addImage(imgData, 'PNG', 10, 10, pdfImgWidth, pdfImgHeight); pdf.save('Smart_Calendar_Schedule.pdf'); }); }; // --- Navigation & Initial Setup --- let currentTab = 1; tabs.forEach(tab => { tab.addEventListener('click', () => { currentTab = parseInt(tab.dataset.tab); tabs.forEach(t => t.classList.remove('active')); tab.classList.add('active'); tabContents.forEach(c => c.classList.remove('active')); getElement(`tab-${currentTab}`).classList.add('active'); }); }); getElement('working-hours-config').addEventListener('change', handleConfigChange); getElement('add-fixed-event-form').addEventListener('submit', handleAddFixedEvent); getElement('add-task-form').addEventListener('submit', handleAddTask); getElement('generate-schedule-btn').addEventListener('click', generateSchedule); getElement('download-pdf-btn').addEventListener('click', generatePDF); loadData(); renderAll(); window.addEventListener('resize', renderCalendar); });
Scroll to Top