feat: mejorar la funcionalidad del selector de tiempo al copiar citas

This commit is contained in:
2026-10-08 11:35:13 -03:00
parent 1438585a0a
commit 215a5b28f4
@@ -612,7 +612,27 @@ export default function OrganizationProfile() {
</div> </div>
<div <div
className={style.buttonPaste} className={style.buttonPaste}
onClick={() => 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));
}}
> >
<ContentPasteIcon /> <ContentPasteIcon />
</div> </div>