diff --git a/package.json b/package.json index 5fd988d..eff35b7 100644 --- a/package.json +++ b/package.json @@ -47,7 +47,6 @@ "dependencies": { "@carbon/react": "^1.33.1", "@hookform/resolvers": "^3.3.4", - "@openmrs/esm-patient-common-lib": "^8.0.1", "fuzzy": "^0.1.3", "lodash-es": "^4.17.21", "react-hook-form": "^7.51.1", @@ -57,6 +56,7 @@ }, "peerDependencies": { "@openmrs/esm-framework": "*", + "@openmrs/esm-patient-common-lib": "8.x", "dayjs": "1.x", "react": "18.x", "react-i18next": "11.x", diff --git a/src/form/post-procedures/post-procedure-form.component.tsx b/src/form/post-procedures/post-procedure-form.component.tsx index 5534f92..4e1e39d 100644 --- a/src/form/post-procedures/post-procedure-form.component.tsx +++ b/src/form/post-procedures/post-procedure-form.component.tsx @@ -37,6 +37,7 @@ import { closeOverlay } from "../../components/overlay/hook"; import { type ConfigObject, StringPath } from "../../config-schema"; import { updateOrder } from "../../procedures-ordered/pick-procedure-order/add-to-worklist-dialog.resource"; import { mutate } from "swr"; +import { closeWorkspace } from "@openmrs/esm-patient-common-lib"; const validationSchema = z.object({ startDatetime: z.date({ required_error: "Start datetime is required" }), @@ -260,9 +261,12 @@ const PostProcedureForm: React.FC = ({ value={value} id="startDatetime" labelText={t("startDatetime", "Start Datetime")} - onChange={onChange} - invalid={!!errors.startDatetime} - invalidText={errors.startDatetime?.message} + onChange={(calendar) => + onChange( + new Date(calendar.year, calendar.month, calendar.day, 0, 0) + ) + } + isInvalid={!!errors.startDatetime} /> )} /> @@ -276,9 +280,12 @@ const PostProcedureForm: React.FC = ({ value={value} id="endDatetime" labelText={t("endDatetime", "End Datetime")} - onChange={onChange} - invalid={!!errors.endDatetime} - invalidText={errors.endDatetime?.message} + onChange={(calendar) => + onChange( + new Date(calendar.year, calendar.month, calendar.day, 0, 0) + ) + } + isInvalid={!!errors.endDatetime} /> )} /> @@ -500,7 +507,7 @@ const PostProcedureForm: React.FC = ({ -