Datepicker event triggered two times

This is the react code to render the date time picker, but the on-change event is triggering twice on value change.

And surprisingly it is returning data in different formats.
image

as you can see, same file same line.

Has anyone faced this issue?

I feel we need to debug FwDatepicker component for this issue. On the outset, the code looks clean. Can you add debounce and try printing the date. Just to see how it behaves and we can check whether the date is printed twice

import { useCallback } from ‘react’;
import { debounce } from ‘lodash’;

const handleDateChange = useCallback(debounce((e) => {
const dateValue = new Date(e.detail.value).toISOString();
console.log(dateValue);
}, 300), );

We can just see whether its printed twice after 300ms seconds here to debug it further. It will be helpful if we can have the code of FwDatepicker for further analysis.