From 32664f73e6bc9e244fe4e4cd9f35f560b12e8d2d Mon Sep 17 00:00:00 2001 From: rdbsolutions Date: Wed, 11 Dec 2024 05:56:41 +0000 Subject: [PATCH] validation on date field in sub field for owner and tenant --- components/elements/index.js | 127 ++++++++++++++++++++--------------- 1 file changed, 73 insertions(+), 54 deletions(-) diff --git a/components/elements/index.js b/components/elements/index.js index 00ac5a20..d2c97843 100644 --- a/components/elements/index.js +++ b/components/elements/index.js @@ -656,17 +656,20 @@ const RenderDatePicker = ({ )} - {touched && error && ( - - - Error: - {" "} - {errorMsg} - - )} + {!custom.hasOwnProperty("showErrorBottom") + ? touched && + error && ( + + + Error: + {" "} + {errorMsg} + + ) + : ""} {/* {value}
@@ -693,6 +696,20 @@ const RenderDatePicker = ({ autoComplete="off" //value={!value ? null : moment(value, "DD/MM/yyyy")} /> + {custom.hasOwnProperty("showErrorBottom") + ? touched && + error && ( + + + Error: + {" "} + {error} + + ) + : ""} @@ -2214,54 +2231,56 @@ const RenderSubFields = ({ fields, meta: { touched, error }, ...custom }) => { return errors; }; + const required = (value) => + value ? undefined : t("newappeal:is-required-label"); return ( -