From ce01c175df2ed314db8d0d4168166f8f36d1f7a0 Mon Sep 17 00:00:00 2001 From: Achmad Setyabudi Susilo Date: Sun, 28 Jun 2026 18:27:49 +0700 Subject: [PATCH] fix(#7): use UTC for DateField initial seed to match pick conversion DateField seeded the picker with ZoneId.systemDefault() but converted the selectedDateMillis back with ZoneId.of("UTC"). For any non-UTC user, the field and the picker displayed different days, and confirming without re-picking silently shifted the export range by a day. Use UTC on both sides (the DatePickerState contract is that selectedDateMillis is UTC midnight of the picked day). --- .../main/java/dev/achmad/ledgerr/ui/components/ExportAction.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/dev/achmad/ledgerr/ui/components/ExportAction.kt b/app/src/main/java/dev/achmad/ledgerr/ui/components/ExportAction.kt index 46aa438..c257545 100644 --- a/app/src/main/java/dev/achmad/ledgerr/ui/components/ExportAction.kt +++ b/app/src/main/java/dev/achmad/ledgerr/ui/components/ExportAction.kt @@ -185,7 +185,7 @@ private fun DateField( ) if (showPicker) { - val initialMillis = date.atStartOfDay(ZoneId.systemDefault()) + val initialMillis = date.atStartOfDay(ZoneId.of("UTC")) .toInstant() .toEpochMilli() val datePickerState = rememberDatePickerState(initialSelectedDateMillis = initialMillis)