I check the document and I found the formatLongDate and I try this but it's not formatting date.
I want my date like this YYYY-MMM-dd but the calendar gave me like this Wed Apr 07 2021 00:00:00 GMT+0000 How can I format this date? I'm really new to React JS. Thank you.
import React, {useState} from 'react';
import Calendar from "react-calendar";
import 'react-calendar/dist/Calendar.css'
const comp = () => {
const [date, setDate] = useState(new Date());
return (
<div>
<Calendar
onChange={setDate}
value={date}
maxDate={new Date()}
formatLongDate={(locale, date) => formatDate(date, 'YYYY-MMM-dd')}
/>
</div>
);
};
export default comp;