Tinysymphony / react-native-calendar-select

A component to select period from calendar like Airbnb
MIT License
308 stars 97 forks source link

Array size is not a small enough positive integer. #18

Closed iqorlobanov closed 3 years ago

iqorlobanov commented 5 years ago

I have an error when scroll to next year on Android.

ERROR: E/ReactNativeJS: RangeError: RangeError: RangeError: RangeError: Array size is not a small enough positive integer.

Here my code:

<Calendar
        i18n="en"
        ref={(calendar) => {this.calendar = calendar;}}
        customI18n={customI18n}
        color={color}
        format="YYYYMMDD"
        minDate="20181221"
        maxDate="20191121"
        startDate={this.state.startDate}
        endDate={this.state.endDate}
        onConfirm={this.confirmDate}
      />

Please help me to fix it

GuiWill1 commented 4 years ago

Just change the min and max date on state and in the component

mpwind commented 4 years ago

I have same issue in Android , I think this is not the problem raised by min/max Date . Solved this by modifying the source code in react-native-calendar-select/Month/index.js

change

row = new Array(dayList.length / 7).fill('');

to

new Array(Math.floor(dayList.length / 7)).fill('');