Reputation: 745
Is there any way to highlight current month's days in React date-picker.
Visually it should look like current month's days are like enabled black colored, and previous-next month's are grey (like disabled, but actually they're still clickable).
<DatePicker
className="form-control"
selected={this.props.dateFrom}
onChange={(momentDate) => {
this.props.changeDateFrom(momentDate);
}}
isClearable={false}
/>
Here is preview of example that I would like to create:
Upvotes: 1
Views: 4825
Reputation: 1552
As Damien suggested you need to over-ride the .react-datepicker__day--outside-month CSS class. The exact CSS would be as below for hiding any dates other than the current month.
.react-datepicker__day--outside-month {
color: transparent !important;
pointer-events: none;
}
Upvotes: 5
Reputation: 307
You can overwrite the CSS of this class:
Upvotes: 7