Skip to content

Commit

Permalink
O3-2720: Visit stop time input not working in edit mode (openmrs#1621)
Browse files Browse the repository at this point in the history
* 03-2720:Visit stop time input not working in edit mode

* Update the commit

* remove redudant new date()

* fix

* update commit
  • Loading branch information
sherrif10 authored Feb 6, 2024
1 parent 6a3d787 commit daf1f03
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -497,8 +497,10 @@ const StartVisitForm: React.FC<StartVisitFormProps> = ({
return [maxVisitStartDatetime, minVisitStopDatetime];
}, [visitToEdit]);

const visitStartDate = getValues('visitStartDate');
const visitStartDate = getValues('visitStartDate') ?? new Date();
minVisitStopDatetime = minVisitStopDatetime ?? Date.parse(visitStartDate.toLocaleString());
const minVisitStopDatetimeFallback = Date.parse(visitStartDate.toLocaleString());
minVisitStopDatetime = minVisitStopDatetime || minVisitStopDatetimeFallback;

useEffect(() => {
if (errorFetchingLocations) {
Expand Down

0 comments on commit daf1f03

Please sign in to comment.