From 215a5b28f49f4e3146c103824f913bdf69309b62 Mon Sep 17 00:00:00 2001 From: Horacio Daniel Ros Date: Thu, 8 Oct 2026 11:35:13 -0300 Subject: [PATCH] feat: mejorar la funcionalidad del selector de tiempo al copiar citas --- .../[id]/appointments/[appdate]/page.tsx | 22 ++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/txclient/src/app/admin/(organization-profile)/org/profile/[id]/appointments/[appdate]/page.tsx b/txclient/src/app/admin/(organization-profile)/org/profile/[id]/appointments/[appdate]/page.tsx index b3e7673..6e44b1a 100644 --- a/txclient/src/app/admin/(organization-profile)/org/profile/[id]/appointments/[appdate]/page.tsx +++ b/txclient/src/app/admin/(organization-profile)/org/profile/[id]/appointments/[appdate]/page.tsx @@ -612,7 +612,27 @@ export default function OrganizationProfile() {
timePicker.show((newDay) => handleMoveAppointment(newDay))} + onClick={() => { + // Seed the controlled picker value with the copied + // appointment's current time. MUI only fires onAccept when the + // accepted value differs from its internal lastCommittedValue; + // without this, picking the same time twice in a row silently + // does nothing. + if (copiedAppointment) { + const currentHour = Math.floor(copiedAppointment.startTime); + const currentMinute = Math.round( + (copiedAppointment.startTime - currentHour) * 60 + ); + timePicker.setValue( + dayjs() + .hour(currentHour) + .minute(currentMinute) + .second(0) + .millisecond(0) + ); + } + timePicker.show((newDay) => handleMoveAppointment(newDay)); + }} >