Skip to content

Commit

Permalink
O3-2461: Can't select earlier date on Appointments form (#827)
Browse files Browse the repository at this point in the history
  • Loading branch information
mogoodrich authored Oct 2, 2023
1 parent 5481f1a commit d810b48
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ const AppointmentForm: React.FC<AppointmentFormProps> = ({ appointment, patientU
const { defaultFacility, isLoading: loadingDefaultFacility } = useDefaultLoginLocation();

const appointmentService = services?.find(({ uuid }) => uuid === patientAppointment.serviceUuid);
const today = dayjs().startOf('day').toDate();

useEffect(() => {
if (locations?.length && sessionUser) {
Expand Down Expand Up @@ -221,7 +222,7 @@ const AppointmentForm: React.FC<AppointmentFormProps> = ({ appointment, patientU
dateFormat="d/m/Y"
datePickerType="single"
id="visitDate"
minDate={patientAppointment.visitDate}
minDate={today}
className={styles.datePickerInput}
onChange={([date]) => setPatientAppointment({ ...patientAppointment, visitDate: date })}
value={patientAppointment.visitDate}>
Expand Down

0 comments on commit d810b48

Please sign in to comment.