React-dates: How do I highlight "today" on the calendar? v12.6.0 upgrading to v15.1.0

Created on 28 Nov 2017  路  6Comments  路  Source: airbnb/react-dates

Using an old version (v12.6.0), this CSS worked:

.CalendarDay--today {
    box-shadow: inset 0 0 2px 1px rgba(0,0,255,1);
    font-weight: bold;
}

To give this effect:

image

How can I do the same thing using a recent version?

I have searched and looked at the v13+ changes, but the answer does not seem obvious. Thanks!

Most helpful comment

v15.2.0 is out! :D

All 6 comments

Hmmm, it looks like this feature got removed by accident. Will add back!

This may have happened during the conversion to using withStyles. Previously there was this:

const className = cx('CalendarDay', {
    'CalendarDay--outside': isOutsideDay,
}, Array.from(modifiers, mod => `CalendarDay--${mod}`));

And within modifiers is "today", so it would have set the class CalendarDay--today.

Put up a PR for a quick fix! :)

@majapw Thanks for the fast fix. It works for me (class changed to .CalendarDay__today).

Do you think there will be a release containing this sometime this week?

Yup! Working on a release right now :)

v15.2.0 is out! :D

Was this page helpful?
0 / 5 - 0 ratings

Related issues

comron picture comron  路  22Comments

ckeeney picture ckeeney  路  22Comments

brunocoelho picture brunocoelho  路  28Comments

kakadiadarpan picture kakadiadarpan  路  22Comments

rodryquintero picture rodryquintero  路  70Comments