adding pilots
This commit is contained in:
@@ -192,7 +192,18 @@ const PilotForm: React.FC<PilotFormProps> = ({
|
|||||||
<Controller
|
<Controller
|
||||||
name="medicalExpiration"
|
name="medicalExpiration"
|
||||||
control={methods.control}
|
control={methods.control}
|
||||||
render={() => <DatePicker />}
|
render={({ field }) => {
|
||||||
|
return (
|
||||||
|
<DatePicker
|
||||||
|
handleDateChanged={(date: string) => {
|
||||||
|
methods.setValue('medicalExpiration', date);
|
||||||
|
}}
|
||||||
|
inputProps={{
|
||||||
|
value: field.value
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -14,7 +14,8 @@ const PilotFormCertificates: React.FC<IPilotFormCertificates> = ({
|
|||||||
}: IPilotFormCertificates) => {
|
}: IPilotFormCertificates) => {
|
||||||
const {
|
const {
|
||||||
control,
|
control,
|
||||||
formState: { errors }
|
formState: { errors },
|
||||||
|
setValue
|
||||||
} = useFormContext();
|
} = useFormContext();
|
||||||
|
|
||||||
const { fields, append, remove } = useFieldArray({
|
const { fields, append, remove } = useFieldArray({
|
||||||
@@ -69,7 +70,16 @@ const PilotFormCertificates: React.FC<IPilotFormCertificates> = ({
|
|||||||
name={`certificates.${index}.dateOfIssue`}
|
name={`certificates.${index}.dateOfIssue`}
|
||||||
control={control}
|
control={control}
|
||||||
render={({ field }) => {
|
render={({ field }) => {
|
||||||
return <DatePicker />;
|
return (
|
||||||
|
<DatePicker
|
||||||
|
handleDateChanged={(date: string) => {
|
||||||
|
setValue(`certificates.${index}.dateOfIssue`, date);
|
||||||
|
}}
|
||||||
|
inputProps={{
|
||||||
|
value: field.value
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
);
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -14,7 +14,8 @@ const PilotFormEndorsements: React.FC<IPilotFormEndorsements> = ({
|
|||||||
}: IPilotFormEndorsements) => {
|
}: IPilotFormEndorsements) => {
|
||||||
const {
|
const {
|
||||||
control,
|
control,
|
||||||
formState: { errors }
|
formState: { errors },
|
||||||
|
setValue
|
||||||
} = useFormContext();
|
} = useFormContext();
|
||||||
|
|
||||||
const { fields, append, remove } = useFieldArray({
|
const { fields, append, remove } = useFieldArray({
|
||||||
@@ -56,8 +57,17 @@ const PilotFormEndorsements: React.FC<IPilotFormEndorsements> = ({
|
|||||||
<Controller
|
<Controller
|
||||||
name={`endorsements.${index}.dateOfIssue`}
|
name={`endorsements.${index}.dateOfIssue`}
|
||||||
control={control}
|
control={control}
|
||||||
render={() => {
|
render={({ field }) => {
|
||||||
return <DatePicker />;
|
return (
|
||||||
|
<DatePicker
|
||||||
|
handleDateChanged={(date: string) => {
|
||||||
|
setValue(`endorsements.${index}.dateOfIssue`, date);
|
||||||
|
}}
|
||||||
|
inputProps={{
|
||||||
|
value: field.value
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
);
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user