From cfcfbc605645ef640d5d5fba5bccb80b78ffafc9 Mon Sep 17 00:00:00 2001
From: DEls
Date: Fri, 30 Oct 2026 00:51:30 +0200
Subject: [PATCH] Preserve arrival date in correction dialog
When a scan is corrected from clock-in to clock-out, retain the scan date and clear only the arrival time so users can enter the actual arrival without re-entering the date.
---
src/app/dashboard/workforce/on-site/correction-dialog.tsx | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/app/dashboard/workforce/on-site/correction-dialog.tsx b/src/app/dashboard/workforce/on-site/correction-dialog.tsx
index bc97062..51e3530 100644
--- a/src/app/dashboard/workforce/on-site/correction-dialog.tsx
+++ b/src/app/dashboard/workforce/on-site/correction-dialog.tsx
@@ -66,7 +66,8 @@ function CorrectionForm({ shift, onClose }: {
function swapToClockOut() {
setOutDate(scanDate);
setOutTime(scanTime);
- setInDate("");
+ // Keep the scan's day so only the arrival time needs typing.
+ setInDate(scanDate);
setInTime("");
}
@@ -187,7 +188,7 @@ function CorrectionForm({ shift, onClose }: {
className="font-medium text-amber-700 underline dark:text-amber-400">
This scan was actually the clock-out
{" "}
- — clears the arrival so you can type the real one.
+ — clears the arrival time so you can type the real one (the date stays).