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.
This commit is contained in:
DEls 2026-10-30 00:51:30 +02:00
parent 9ff13b3ce6
commit cfcfbc6056

View file

@ -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
</button>{" "}
— clears the arrival so you can type the real one.
— clears the arrival time so you can type the real one (the date stays).
</p>
</fieldset>
<fieldset className="grid grid-cols-2 gap-3">