fawinell
fawinell

Reputation: 313

How can I disabled the view change of react-calendar?

when I click the Prev Button or Next Button, there is not any function can control it. eg: When I click the Prev Button, I want a Toast a string, AND DO NOT GO TO THE PREV VIEW. However, there is no any Function can I disabled it.

I put the issue on the github of react-calendar, but the author says I should post this on here (stack-overflow).

Upvotes: 0

Views: 2063

Answers (2)

Nitesh Raut Kshettri
Nitesh Raut Kshettri

Reputation: 27

For the one using version less than 3.5.0, you can always use css to hide those buttons.

Upvotes: 0

Wojciech Maj
Wojciech Maj

Reputation: 1102

Prev/Next buttons are disabled based on minDate and maxDate. There's no way to manually disable these buttons.

You can use onActiveStartDateChange to monitor change of "active start date" (the date currently shown view starts on). onActiveStartDateChange, since 3.5.0, will also let you know using action which action triggered the callback.

Upvotes: 1

Related Questions