hypeserver / react-date-range

A React component for choosing dates and date ranges.
MIT License
2.57k stars 658 forks source link

Adding isFirstEnabledDay on main day element #520

Closed celdrake closed 1 year ago

celdrake commented 2 years ago

Types of changes

Description

Currently, the library adds a class to "today", assuming this is the first enabled day of the month.

However, when we set minDate to a different day other than today, we can't target the outer element of the first enabled day of the month. We can only target its content with dayContentRenderer, but that doesn't cover all cases for styling.

So this PR adds a rdrDayEnabledFirst class to the first enabled day of the Calendar month (if minDate is set). It doesn't perform any styling for this selector.

I believe this should be useful for other people as well. I also tried accessing the first enabled day by CSS but I couldn't get it working.