Online Automated Daily Planner & Scheduler

Online Automated Daily Planner & Scheduler

Organize your day by prioritizing tasks and automatically creating a schedule.

Your Daily Schedule

No tasks configured. Please go to the 'Task Configuration' tab to add your tasks.

Manage Your Tasks

${formatTime(startTime)} - ${formatTime(endTime)} (${task.duration} min)

${task.priority}
`; // Update current time for the next task, including the break currentTime = new Date(endTime.getTime() + breakDuration * 60000); }); scheduleOutput.innerHTML = scheduleHTML; } /** * Handles the PDF download functionality. */ function downloadPDF() { const { jsPDF } = window.jspdf; const taskItems = document.querySelectorAll('.task-item'); if (taskItems.length === 0) { console.warn("No data to export."); return; } const tasks = Array.from(taskItems).map(item => { const inputs = item.querySelectorAll('input, select'); return { name: inputs[0].value || 'Untitled Task', priority: inputs[1].value, duration: parseInt(inputs[2].value, 10) || 30 }; }); const priorityOrder = { 'High': 1, 'Medium': 2, 'Low': 3 }; tasks.sort((a, b) => priorityOrder[a.priority] - priorityOrder[b.priority]); const startTimeInput = document.getElementById('start-time').value; const breakDuration = parseInt(document.getElementById('break-between-tasks').value, 10) || 0; const [startHour, startMinute] = startTimeInput.split(':').map(Number); let currentTime = new Date(); currentTime.setHours(startHour, startMinute, 0, 0); const tableData = tasks.map(task => { const startTime = new Date(currentTime); const endTime = new Date(startTime.getTime() + task.duration * 60000); const formatTime = (date) => date.toLocaleTimeString('en-US', { hour: '2-digit', minute: '2-digit', hour12: true }); const timeSlot = `${formatTime(startTime)} - ${formatTime(endTime)}`; currentTime = new Date(endTime.getTime() + breakDuration * 60000); return [timeSlot, task.name, task.priority, `${task.duration} min`]; }); const doc = new jsPDF(); doc.setFontSize(18); doc.text('Daily Schedule', 14, 22); doc.setFontSize(11); doc.setTextColor(100); doc.text(`Schedule for: ${new Date().toLocaleDateString()}`, 14, 30); doc.autoTable({ head: [['Time Slot', 'Task', 'Priority', 'Duration']], body: tableData, startY: 35, theme: 'grid', headStyles: { fillColor: [13, 148, 136] }, // Teal-600 }); doc.save('Daily-Schedule.pdf'); } // --- Event Listeners --- addTaskBtn.addEventListener('click', addTaskForm); downloadPdfBtn.addEventListener('click', downloadPDF); // --- Initial Setup --- updateNavButtons(); generateSchedule(); });
Scroll to Top