Skip to content

Commit

Permalink
fix: selected enddate issue on market change
Browse files Browse the repository at this point in the history
  • Loading branch information
Nuzhy-Deriv committed Aug 9, 2024
1 parent dd87956 commit 2878f77
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/javascript/app/pages/form/form-component.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<BreakpointProvider>
Expand Down

0 comments on commit 2878f77

Please sign in to comment.