diff --git a/src/components/Patient/PatientRegistration.tsx b/src/components/Patient/PatientRegistration.tsx index 13d8b211ed8..65fc1aac255 100644 --- a/src/components/Patient/PatientRegistration.tsx +++ b/src/components/Patient/PatientRegistration.tsx @@ -55,7 +55,7 @@ import dayjs from "@/Utils/dayjs"; import routes from "@/Utils/request/api"; import mutate from "@/Utils/request/mutate"; import query from "@/Utils/request/query"; -import { parsePhoneNumber } from "@/Utils/utils"; +import { dateQueryString, parsePhoneNumber } from "@/Utils/utils"; import GovtOrganizationSelector from "@/pages/Organization/components/GovtOrganizationSelector"; import { PatientModel } from "@/types/emr/patient"; import { Organization } from "@/types/organization/organization"; @@ -519,7 +519,7 @@ export default function PatientRegistration( field.value ? new Date(field.value) : undefined } onChange={(date) => - field.onChange(date?.toISOString()) + field.onChange(dateQueryString(date)) } id="dob" /> diff --git a/src/pages/PublicAppointments/PatientRegistration.tsx b/src/pages/PublicAppointments/PatientRegistration.tsx index f4a4c77ed3f..fc3888defa5 100644 --- a/src/pages/PublicAppointments/PatientRegistration.tsx +++ b/src/pages/PublicAppointments/PatientRegistration.tsx @@ -323,7 +323,7 @@ export function PatientRegistration(props: PatientRegistrationProps) { field.value ? new Date(field.value) : undefined } onChange={(date) => - field.onChange(date?.toISOString()) + field.onChange(dateQueryString(date)) } id="dob" />