diff --git a/src/pages/Appoinments/PatientRegistration.tsx b/src/pages/Appoinments/PatientRegistration.tsx index 26e28eb796c..e14ccb137bf 100644 --- a/src/pages/Appoinments/PatientRegistration.tsx +++ b/src/pages/Appoinments/PatientRegistration.tsx @@ -9,7 +9,6 @@ import { z } from "zod"; import CareIcon from "@/CAREUI/icons/CareIcon"; import { Button } from "@/components/ui/button"; -import { DatePicker } from "@/components/ui/date-picker"; import { Form, FormControl, @@ -23,6 +22,7 @@ import { Label } from "@/components/ui/label"; import { RadioGroup, RadioGroupItem } from "@/components/ui/radio-group"; import { Textarea } from "@/components/ui/textarea"; +import DateFormField from "@/components/Form/FormFields/DateFormField"; import { Appointment, AppointmentCreate, @@ -324,11 +324,24 @@ export function PatientRegistration(props: PatientRegistrationProps) { {t("date_of_birth")} - field.onChange(date)} + onChange={(dateObj: { + name: string; + value: Date; + }) => { + if (dateObj?.value instanceof Date) { + field.onChange(dateObj.value.toISOString()); + } else { + field.onChange(null); + } + }} + disableFuture + min={new Date(1900, 0, 1)} + className="-mb-6" /> @@ -396,13 +409,11 @@ export function PatientRegistration(props: PatientRegistrationProps) { name="geo_organization" render={({ field }) => ( - {t("organization")} { - console.log(value); field.onChange(value); }} />