From 01bb090f49568ddd6026d73496dd5cbc02d0e73f Mon Sep 17 00:00:00 2001 From: Shyam Prakash <106866225+shyamprakash123@users.noreply.github.com> Date: Tue, 23 Jan 2024 21:05:16 +0530 Subject: [PATCH] Changed to current date time instead of date time at which app was loaded. (#6791) * Changed to current date time instead of date time at which app was loaded * Changed to encounter_date * removed console.log() * modified FLAKY TEST --------- Co-authored-by: Mohammed Nihal <57055998+nihal467@users.noreply.github.com> --- src/Components/Facility/ConsultationForm.tsx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Components/Facility/ConsultationForm.tsx b/src/Components/Facility/ConsultationForm.tsx index a493d354be2..d7bc5f67a70 100644 --- a/src/Components/Facility/ConsultationForm.tsx +++ b/src/Components/Facility/ConsultationForm.tsx @@ -325,6 +325,13 @@ export const ConsultationForm = ({ facilityId, patientId, id }: Props) => { fetchPatientName(); }, [dispatchAction, patientId]); + useEffect(() => { + dispatch({ + type: "set_form", + form: { ...state.form, encounter_date: new Date() }, + }); + }, []); + const hasSymptoms = !!state.form.symptoms.length && !state.form.symptoms.includes(1); const isOtherSymptomsSelected = state.form.symptoms.includes(9);