bugfix: alt+left/right couldn't change month
authorPhiTux <redacted>
Sun, 2 Nov 2025 10:03:27 +0000 (11:03 +0100)
committerPhiTux <redacted>
Sun, 2 Nov 2025 10:03:27 +0000 (11:03 +0100)
frontend/src/routes/(authed)/write/+page.svelte

index 1595f129e1b554828a9f67c27f645ffd4420a6ce..c2545b8909c74a6f163b1722a104d9dc755cba31 100644 (file)
        }
 
        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()
                };
        }
 
git clone https://git.99rst.org/PROJECT