Vi har morgondagen som förvalt datum istället för idag

This commit is contained in:
2025-01-24 18:30:01 +01:00
parent 892c20dfae
commit eb5adae406

View File

@@ -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
});
});