import React, { useState } from "react"
import DatePicker, { DateObject } from "react-multi-date-picker"
import colors from "react-multi-date-picker/plugins/colors"
import DatePanel from "react-multi-date-picker/plugins/date_panel";
.
.
.
const yesterday = new DateObject().subtract(1, "day");
const today = new DateObject();
const tomorrow = new DateObject().add(1, "day");
yesterday.color = "red";
today.color = "blue";
tomorrow.color = "red";
const [props, setProps] = useState({
multiple: true,
value: [yesterday, today, tomorrow],
plugins: [
colors({ colors: ["blue", "red"] }),
<DatePanel sort="color" />,
],
});
.
.
.
<DatePicker
{...props}
onPropsChange={setProps}
/>