diff --git a/src/App.svelte b/src/App.svelte index c3bedf8..bb2dd83 100644 --- a/src/App.svelte +++ b/src/App.svelte @@ -15,6 +15,7 @@ let selectedDate = new Date().toDateString(); let draggedItem = null; let draggedOverIndex = null; + let currentDateDisplay = ''; function addTask() { if (newTask.trim()) { @@ -85,13 +86,16 @@ draggedOverIndex = null; } - function getCurrentDate() { - return new Date().toLocaleDateString('en-US', { - weekday: 'long', - year: 'numeric', - month: 'long', - day: 'numeric' - }); + $: { + currentDateDisplay = (() => { + const date = new Date(selectedDate); + return date.toLocaleDateString('en-US', { + weekday: 'long', + year: 'numeric', + month: 'long', + day: 'numeric' + }); + })(); } function getDateKey(dateString) { @@ -282,7 +286,7 @@