maggialejandro/react-native-calendario

Month of October cannot be disabled

Closed this issue · 1 comments

Current behaviour

<Calendar
  ...
    disabledDays={{ '2022-10-15': true }}
....
  />

Expected behaviour

Expected 15 October 2022 to be disabled, but it is not

What have you tried

In react-native-month, components/utils.js,

change

const fullMonth = month < 10 ? `0${month + 1}` : (month + 1).toString();

to

const fullMonth = month < 9 ? `0${month + 1}` : (month + 1).toString();

fixes the issue, as month starts from 0 in JS

Before, 15 October 2022 was wrongly formatted as: 2022-010-15
after the fix, 15 October 2022 will be formatted as 2022-10-15

and date disabling for any date in October works again

stale commented

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. You may also mark this issue as a "discussion" and I will leave this open.