diff --git a/packages/esm-patient-chart-app/src/visit/visit-form/visit-form.component.tsx b/packages/esm-patient-chart-app/src/visit/visit-form/visit-form.component.tsx index 343ac9be2a..d7a2a25cca 100644 --- a/packages/esm-patient-chart-app/src/visit/visit-form/visit-form.component.tsx +++ b/packages/esm-patient-chart-app/src/visit/visit-form/visit-form.component.tsx @@ -144,7 +144,7 @@ const StartVisitForm: React.FC = ({ let defaultValues: Partial = { visitStartDate, visitStartTime: dayjs(visitStartDate).format('hh:mm'), - visitStartTimeFormat: visitStartDate.getDate() >= 12 ? 'PM' : 'AM', + visitStartTimeFormat: visitStartDate.getHours() >= 12 ? 'PM' : 'AM', visitType: visitToEdit?.visitType?.uuid, visitLocation: visitToEdit?.location ?? sessionLocation ?? {}, @@ -163,7 +163,7 @@ const StartVisitForm: React.FC = ({ ...defaultValues, visitStopDate, visitStopTime: dayjs(visitStopDate).format('hh:mm'), - visitStopTimeFormat: visitStopDate.getDate() >= 12 ? 'PM' : 'AM', + visitStopTimeFormat: visitStopDate.getHours() >= 12 ? 'PM' : 'AM', }; }