From 53147caebccce09cb54c07e2e2ba6ec0619234d7 Mon Sep 17 00:00:00 2001 From: RaktimaNXG Date: Wed, 13 Mar 2024 17:47:31 +0530 Subject: [PATCH] fix: checkbox checked issue in signyour-self flow --- .../src/components/pdf/Placeholder.js | 32 ++++++++++++------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/apps/OpenSign/src/components/pdf/Placeholder.js b/apps/OpenSign/src/components/pdf/Placeholder.js index 719ed77a1..bb93d16ba 100644 --- a/apps/OpenSign/src/components/pdf/Placeholder.js +++ b/apps/OpenSign/src/components/pdf/Placeholder.js @@ -90,20 +90,29 @@ function Placeholder(props) { const [isDraggingEnabled, setDraggingEnabled] = useState(true); const [isShowDateFormat, setIsShowDateFormat] = useState(false); const [selectDate, setSelectDate] = useState({ - date: moment( - getDefaultdate( - props?.pos?.options?.response, - props.pos?.options?.validation?.format - ).getTime() - ).format(changeDateToMomentFormat(props.pos?.options?.validation?.format)), - format: getDefaultFormat(props.pos?.options?.validation?.format) + date: + props.pos.type === "date" + ? moment( + getDefaultdate( + props?.pos?.options?.response, + props.pos?.options?.validation?.format + ).getTime() + ).format( + changeDateToMomentFormat(props.pos?.options?.validation?.format) + ) + : "", + format: + props.pos.type === "date" + ? getDefaultFormat(props.pos?.options?.validation?.format) + : "" }); const [dateFormat, setDateFormat] = useState([]); const [startDate, setStartDate] = useState( - getDefaultdate( - props?.pos?.options?.response, - props.pos?.options?.validation?.format - ) + props.pos.type === "date" && + getDefaultdate( + props?.pos?.options?.response, + props.pos?.options?.validation?.format + ) ); const dateFormatArr = [ "L", @@ -117,6 +126,7 @@ function Placeholder(props) { "DD MMMM, YYYY" ]; + useEffect(() => {}, []); //function change format array list with selected date and format const changeDateFormat = () => { const updateDate = [];