I am using react-date-picker library in my project. I need to display placeholder in datepicker instead of already chosen date. I've managed to achieve this
but it seems that when user opens calendar it doesn't display any active day
.
I would like that to be by default today. I've found in react-calendar library that there is a prop activeStartDate which should do exactly what I need, but for some reason it does not work. What do I do wrong?
import React, { useState } from "react";
import DatePicker from "react-date-picker";
import SVGIcon from "components/SVGIcon/SVGIcon";
import "./date-picker.scss";
const Calendar = () => {
const [value, onChange] = useState(null);
let today = new Date();
return (
<div className="wrapper">
<DatePicker
onChange={onChange}
value={value}
calendarIcon={<SVGIcon name="calendar" />}
prevLabel={<SVGIcon name="buttonArrow" />}
nextLabel={<SVGIcon name="buttonArrow" />}
locale="en-GB"
dayPlaceholder="day"
monthPlaceholder="month"
yearPlaceholder="year"
activeStartDate={today}
/>
</div>
);
};
export default Calendar;
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…