First of all, thanks for all your efforts for making this great library. I tried to add arrows to a <CalendarList /> component and after I did that, the month change event seems to have some issues.
I've added arrows for <CalendarList /> component and the month subtraction and addMonth are working perfectly fine and it's working. But the issue is whenever I want to set new markedDates on the calendar when the month has been changed, the event onMonthChange is not firing.
I tried to use onVisibleMonthsChange instead but it's firing multiple times even though pagingEnabled is set to true.
Alternatively if there is a way to get the current state of the calendar (month, year, etc.) that would be good.
Any help ?
Thanks.
I can confirm this bug exists with CalendarList Horizontal as of the latest 1.20.0 on master branch
I have the same problem. I want to create custom header but can't know current month. Help pls!
and have ('now these months are visible undefined' or aray width two or one month or nothing )
CC: @tautvilas @katrin_zot
+1
any news here?
I've removed those two lines:
onPressArrowLeft={subtrackMonth => subtrackMonth()}
onPressArrowRight={addMonth => addMonth()}
And started just using this method like so:
onVisibleMonthsChange={months => {
console.log("on visible", months[months.length - 1].month);
}}
It works pretty good by clicking left/right arrows or by swiping the view in CalendarList.
<CalendarList /> horizontal configuration, onVisibleMonthsChange gets triggered multiple times. Sometimes array with two month data and sometimes just an array with only one month data(which is correct). If we get multiple data array, it will be followed by another onVisibleMonthsChange with array having only one month's data .So it causes us to skip months while swiping.
Has any one has any work around for the same?
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.
Most helpful comment
I can confirm this bug exists with
CalendarListHorizontal as of the latest 1.20.0 on master branch