I am using react-bootstrap and set one of the form-control to type=”date”, but the initial date value is not shown, instead it shown the date format.
This is what I have:
const [startDate, setStartDate] = useState(new Date());
return <Form.Control type="date" value={moment(startDate).format("D-MM-YYYY")} onChange=((e) => setStartDate(e.target.value)) />
This should show the date of now as initial value. But it doesn’t, when I look at the source code it shows the value correctly, but somehow the placeholder or so shows the format instead.
I did try to set the placeholder with the same value, but nothing happened.
Am I missing anything?