react-date-range icon indicating copy to clipboard operation
react-date-range copied to clipboard

Adding isFirstEnabledDay on main day element

Open celdrake opened this issue 4 years ago • 0 comments

Types of changes

  • [ ] Bugfix (non-breaking change which fixes an issue)
  • [x] New feature (non-breaking change which adds functionality)
  • [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)

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.

celdrake avatar Sep 23 '21 15:09 celdrake