After-Work Hours Usage Optimizer

After-Work Hours Usage Optimizer

Your Available After-Work Hours

Weekdays

Weekends

Weekly Time Allocation Goals (Hours per Week)

Custom Categories

Please define your availability and goals in the first tab, then click "Generate Summary & View Report".

No time allocated to specific goals yet.

"; } reportHTML += `
`; reportHTML += `

Optimization Summary

Time Balance (Available - Planned): ${balanceHours.toFixed(1)} hours
Recommendation: ${optimizationMessage}
`; document.getElementById('awh-report-content-display').innerHTML = reportHTML; awhOpenTab(null, 'awh-summary-report'); awhUpdateNavButtons(); } function awhDownloadPDF() { const reportContentElement = document.getElementById('awh-report-content-display'); if (reportContentElement.innerHTML.includes("Please define your availability")) { alert("Please generate a report first before downloading the PDF."); return; } const pdfContentClone = reportContentElement.cloneNode(true); const pdfContainer = document.getElementById('awh-report-content-for-pdf'); pdfContainer.innerHTML = ''; pdfContainer.appendChild(pdfContentClone); const opt = { margin: [0.5, 0.5, 0.5, 0.5], // inches filename: 'After_Work_Hours_Plan.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."); }); } // Initialize document.addEventListener('DOMContentLoaded', () => { awhPopulatePredefinedCategories(); awhAddCustomCategoryRow(); // Add one empty custom category row to start awhUpdateNavButtons(); awhOpenTab(null, 'awh-define-time'); // Ensure correct tab is active visually });
Scroll to Top