From 2878f77078dbc1b3f4b7b21b8c91d912284c8cc5 Mon Sep 17 00:00:00 2001 From: Nuzhy-Deriv Date: Fri, 9 Aug 2024 19:24:24 +0800 Subject: [PATCH] fix: selected enddate issue on market change --- src/javascript/app/pages/form/form-component.jsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/javascript/app/pages/form/form-component.jsx b/src/javascript/app/pages/form/form-component.jsx index bea2ae70658..229196b3285 100644 --- a/src/javascript/app/pages/form/form-component.jsx +++ b/src/javascript/app/pages/form/form-component.jsx @@ -155,7 +155,13 @@ export const FormComponent = () => { { text: localize('Payout'), value: 'payout' }, ]; - const formatEndDate = (date) => moment(date).format('ddd - DD MMM, YYYY'); + const formatEndDate = (date) => { + const expriry_date_obj = endtime_data.options.find(obj => obj.value === date); + if (expriry_date_obj) { + return moment(date).format('ddd - DD MMM, YYYY'); + } + return moment(endtime_data.options[0].value).format('ddd - DD MMM, YYYY'); + }; return (