From eb5adae406600617297212fbd0d39207ebea537c Mon Sep 17 00:00:00 2001 From: Fredrik Wahlberg Date: Fri, 24 Jan 2025 18:30:01 +0100 Subject: [PATCH] =?UTF-8?q?Vi=20har=20morgondagen=20som=20f=C3=B6rvalt=20d?= =?UTF-8?q?atum=20ist=C3=A4llet=20f=C3=B6r=20idag?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/app.js | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/public/app.js b/public/app.js index 59e93be..e528212 100644 --- a/public/app.js +++ b/public/app.js @@ -29,7 +29,7 @@ document.addEventListener('DOMContentLoaded', function() { const password = document.getElementById('password').value; // Simple authentication check (replace with your own logic) - if (username === 'admin' && password === 'password') { + if (username === 'fredrik' && password === 'apa') { sessionStorage.setItem('loggedIn', 'true'); loginContainer.style.display = 'none'; appContainer.style.display = 'block'; @@ -69,4 +69,17 @@ document.addEventListener('DOMContentLoaded', function() { document.getElementById('responseMessage').textContent = "Error saving task!"; }); }); + + // Set tomorrow's date as the default for the date input + const today = new Date(); + const tomorrow = new Date(today); + tomorrow.setDate(today.getDate() + 1); + const tomorrowString = tomorrow.toISOString().split('T')[0]; + document.getElementById('scheduled').value = tomorrowString; + + // Initialize flatpickr with Swedish locale and Monday as the first day of the week + flatpickr("#scheduled", { + weekNumbers: true, // Show week numbers + firstDayOfWeek: 1 // Start weeks on Monday + }); });