{
number: "",
complement: "",
state: undefined,
- city: undefined
+ city: undefined,
+ date_registration: new Date(Date.now())
};
diff --git a/src/Context/Beneficiaries/BeneficiaresCreate/type.ts b/src/Context/Beneficiaries/BeneficiaresCreate/type.ts
index 5daf8d2..f57d9ff 100644
--- a/src/Context/Beneficiaries/BeneficiaresCreate/type.ts
+++ b/src/Context/Beneficiaries/BeneficiaresCreate/type.ts
@@ -18,6 +18,7 @@ export interface BeneficiariesCreateType {
project: number | undefined,
deficiency_description: string | undefined
kinship: string
+ date_registration: string | undefined | any
};
tsOne: Tsone | undefined;
project: any | undefined;
diff --git a/src/Context/Beneficiaries/BeneficiaresEdit/state.tsx b/src/Context/Beneficiaries/BeneficiaresEdit/state.tsx
index f7f986d..9462f00 100644
--- a/src/Context/Beneficiaries/BeneficiaresEdit/state.tsx
+++ b/src/Context/Beneficiaries/BeneficiaresEdit/state.tsx
@@ -74,7 +74,8 @@ export const BeneficiariesEditState = () => {
number: registrations?.number ?? "",
complement: registrations?.complement ?? "",
state: registrations?.state_fk ?? "",
- city: registrations?.city_fk ?? ""
+ city: registrations?.city_fk ?? "",
+ date_registration: new Date(registrations?.date_registration) ?? ""
};
const CreateRegisterClassroom = (data: CreateRegistrationClassroomType) => {
diff --git a/src/Context/Beneficiaries/BeneficiaresEdit/type.ts b/src/Context/Beneficiaries/BeneficiaresEdit/type.ts
index e06abba..f969786 100644
--- a/src/Context/Beneficiaries/BeneficiaresEdit/type.ts
+++ b/src/Context/Beneficiaries/BeneficiaresEdit/type.ts
@@ -44,6 +44,7 @@ export interface Registration {
neighborhood: any
city_fk: any
state_fk: any
+ date_registration: any
register_term: RegisterTerm[]
register_classroom: RegisterClassroom[]
}
diff --git a/src/Context/Classroom/Registration/state.tsx b/src/Context/Classroom/Registration/state.tsx
index d3cd740..1a00dc6 100644
--- a/src/Context/Classroom/Registration/state.tsx
+++ b/src/Context/Classroom/Registration/state.tsx
@@ -37,8 +37,8 @@ export const RegistrationClassroomState = () => {
responsable_telephone: registration?.registration.responsable_telephone,
status: getStatus(registration?.status!),
deficiency_description: registration?.registration.deficiency_description,
- kinship: registration?.registration.kinship
-
+ kinship: registration?.registration.kinship,
+ date_registration: registration?.registration.date_registration ?? ""
};
const handleUpdateRegistration = (data: UpdateRegister, id: number) => {
diff --git a/src/Context/Classroom/Registration/type.tsx b/src/Context/Classroom/Registration/type.tsx
index 7a19088..4319a15 100644
--- a/src/Context/Classroom/Registration/type.tsx
+++ b/src/Context/Classroom/Registration/type.tsx
@@ -30,6 +30,7 @@ export interface UpdateRegister
registration_classroom_id?: number
deficiency_description: any
kinship: string | undefined | null
+ date_registration: any
}
export interface RegistrationType {
avatar_url: string
@@ -60,4 +61,5 @@ export interface Registration {
updatedAt: string
kinship: string
register_term?: any
+ date_registration: any
}
diff --git a/src/Pages/Beneficiaries/BeneficiariesCreate/index.tsx b/src/Pages/Beneficiaries/BeneficiariesCreate/index.tsx
index a787910..2f644a9 100644
--- a/src/Pages/Beneficiaries/BeneficiariesCreate/index.tsx
+++ b/src/Pages/Beneficiaries/BeneficiariesCreate/index.tsx
@@ -376,6 +376,21 @@ const RegistrationPage = () => {
) : null}
) : null}
+ {values.project &&
+
+
+
+ {errors.date_registration && touched.date_registration ? (
+
+ {String(errors.date_registration)}
+
+ ) : null}
+
}
{" "}
Endereço
diff --git a/src/Pages/Beneficiaries/BeneficiariesEdit/index.tsx b/src/Pages/Beneficiaries/BeneficiariesEdit/index.tsx
index 9c4e5eb..cca3e83 100644
--- a/src/Pages/Beneficiaries/BeneficiariesEdit/index.tsx
+++ b/src/Pages/Beneficiaries/BeneficiariesEdit/index.tsx
@@ -32,6 +32,7 @@ import ModalCreateRegisterClassroom from "./ModalCreateRegisterClassroom";
import { validaCPF } from "../../../Controller/controllerValidCPF";
import ModalAddTerm from "./ModalAddTerm";
import Icon from "../../../Components/Icon";
+import CalendarComponent from "../../../Components/Calendar";
const BeneficiariesEdit = () => {
@@ -160,7 +161,7 @@ const BeneficiariesEditPage = () => {
}}
>
{({ values, handleChange, errors, touched, setFieldValue }) => {
-
+ console.log(values)
const errorArray = getErrorsAsArray(errors);
return (