From: PhiTux Date: Sun, 2 Nov 2025 10:03:27 +0000 (+0100) Subject: bugfix: alt+left/right couldn't change month X-Git-Url: http://git.99rst.org/?a=commitdiff_plain;h=276aafe48b375702901fe05ea9ff8148a13502e8;p=DailyTxT.git bugfix: alt+left/right couldn't change month --- diff --git a/frontend/src/routes/(authed)/write/+page.svelte b/frontend/src/routes/(authed)/write/+page.svelte index 1595f12..c2545b8 100644 --- a/frontend/src/routes/(authed)/write/+page.svelte +++ b/frontend/src/routes/(authed)/write/+page.svelte @@ -196,10 +196,14 @@ } function changeDay(increment) { + // Build a Date from the current selectedDate (note: JS Date months are 0-based) + const current = new Date($selectedDate.year, $selectedDate.month - 1, $selectedDate.day); + current.setDate(current.getDate() + increment); + $selectedDate = { - day: $selectedDate.day + increment, - month: $selectedDate.month, - year: $selectedDate.year + day: current.getDate(), + month: current.getMonth() + 1, + year: current.getFullYear() }; }