My date-time format from the api result is 2019-12-30T06:16:48.453Z
. It is not supported by the react-datepicker
.
My code is following and is a functional component. I didn't write the complete code below. Added just the required parts.
import DatePicker from "react-datepicker";
import "react-datepicker/dist/react-datepicker.css";
<DatePicker
selected={'2019-12-30T06:16:48.453Z'}
{...props}
/>
I also tried adding moment
by importing it and used as selected={moment('2019-12-30T06:16:48.453Z')}
I'm getting the error in both cases like Maximum update depth exceeded
.