From 24a62b6685805dd0aa82b38e677392da2d074df9 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 16 Apr 2026 07:20:50 +0000 Subject: [PATCH] fix: correct isToday check in DateTimePicker getMonth() returns 0-11, but the comparison string was not adjusting for this, so the "today" highlight in the calendar never matched. https://claude.ai/code/session_013ooJht2HrZUTXgNJFU79cV --- apps/tauri/src/lib/components/DateTimePicker.svelte | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/tauri/src/lib/components/DateTimePicker.svelte b/apps/tauri/src/lib/components/DateTimePicker.svelte index f6415d3..92d92cf 100644 --- a/apps/tauri/src/lib/components/DateTimePicker.svelte +++ b/apps/tauri/src/lib/components/DateTimePicker.svelte @@ -18,7 +18,7 @@ let selectedMinute = $state(existing ? existing.getMinutes() : 0); let visible = $state(false); - let todayStr = `${now.getFullYear()}-${now.getMonth()}-${now.getDate()}`; + let todayStr = `${now.getFullYear()}-${now.getMonth() + 1}-${now.getDate()}`; let daysInMonth = $derived(new Date(viewYear, viewMonth + 1, 0).getDate()); let firstDayOfWeek = $derived(new Date(viewYear, viewMonth, 1).getDay()); @@ -53,7 +53,7 @@ } function isToday(day: number): boolean { - return `${viewYear}-${viewMonth}-${day}` === todayStr; + return `${viewYear}-${viewMonth + 1}-${day}` === todayStr; } function isSelected(day: number): boolean {