I am creating a react component that allows user to pick a date using a simple "input" field with "date" type. The problem is that I can't manage to display dates in the format "dd/mm/yyyy". it is always displayed as "mm/dd/yyyy".
const [date, setDate] = useState(new Date());
const handleChange = (event) => {
setDate(new Date(event.target.value));
};
const formattedDate = date.toISOString().slice(0, 10);
console.log("Date", formattedDate)
return(
<input type="date" value={formattedDate} onChange={handleChange} />
)