From b39f0e73394c9e794234d58687b0ccc5df8bfac5 Mon Sep 17 00:00:00 2001 From: Fredrik Wahlberg Date: Sat, 25 Jan 2025 12:05:33 +0100 Subject: [PATCH] Set default date for datepicker to tomorrow and update navigation visibility --- public/app.js | 9 ++++++++- public/index.html | 5 +---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/public/app.js b/public/app.js index fcb4d3f..70e0957 100644 --- a/public/app.js +++ b/public/app.js @@ -26,9 +26,16 @@ document.addEventListener('DOMContentLoaded', function() { // Initialize Materialize components M.Sidenav.init(sidenav); + + // Calculate tomorrow's date + const today = new Date(); + const tomorrow = new Date(today); + tomorrow.setDate(today.getDate() + 1); + + // Initialize datepicker with tomorrow as the default date M.Datepicker.init(document.querySelectorAll('.datepicker'), { format: 'yyyy-mm-dd', - defaultDate: new Date(), + defaultDate: tomorrow, setDefaultDate: true, firstDay: 1 }); diff --git a/public/index.html b/public/index.html index 7b08529..57f1bfa 100644 --- a/public/index.html +++ b/public/index.html @@ -31,13 +31,10 @@