CalendarList always shows minimum of three months in scroll
Description
CalendarList component always shows three months.
Expected Behavior
When setting the props, I'd expect the CalendarList to show less than three months if required
Observed Behavior
No matter what I set in the props the CalendarList will default to showing minimum of three months.
Environment
npm ls react-native-calendars: [email protected]npm ls react-native: [email protected]
Also specify:
- Phone/emulator/simulator & version: iOS Simulator on iOS 10.3
Reproducible Demo
Below will show the current month, along with the next two months. I only want the current month and the next month to be shown. Also if i wish to set the futureScrollRange to be zero, to only show the current month.
import { CalendarList } from 'react-native-calendars';
class Demo extends Component {
render() {
return (
<CalendarList
pastScrollRange={0}
futureScrollRange={1}
/>
}
}
Hi, yes there is currently such limitation. Maybe you could also overcome this by using two Calendar components instead of CalendarList ?
Out of curiosity where in this library are we forcing minimum of three months?
I think here:
https://github.com/wix/react-native-calendars/blob/master/src/calendar-list/index.js#L52
There would be some bugs if there are less than 3 months, I think. need to check it.
I set pastScrollRange={0} and futureScrollRange={1} and see error No item for index 2.
It is working correctly when futureScrollRange is greater or equal than 2.
resolved in 1.14.1