React-calendar: Past date class

Created on 4 Sep 2019  路  2Comments  路  Source: wojtekmaj/react-calendar

I'd love to be able to style past dates differently, but still allow past dates to be selected (so I can't use minDate to solve this use case).

I'm wondering if you'd consider adding a class like "react-calendar__tile--past" for any past date?

Thanks for the great library!

question

Most helpful comment

Oh wow, pretty embarrassed I missed that, sorry for wasting your time but thanks for the response and again, thanks for the fantastic library!

All 2 comments

Hi,
use tileClassName for that. Something like:

```js
tileClassName={({ date }) => {
if (isDateInThePast(date)) {
return 'react-calendar__tile--past';
}
return null;
}}

Oh wow, pretty embarrassed I missed that, sorry for wasting your time but thanks for the response and again, thanks for the fantastic library!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Coder2012 picture Coder2012  路  5Comments

rmccue picture rmccue  路  4Comments

boonware picture boonware  路  4Comments

Muttakee31 picture Muttakee31  路  4Comments

dumkanki picture dumkanki  路  4Comments