farhoudshapouran / react-native-ui-datepicker

Customizable React Native 📅 DatePicker component for Android, iOS, and Web. It includes single, range and multiple modes and supports different locales.
https://farhoudshapouran.github.io/react-native-ui-datepicker/
MIT License
275 stars 28 forks source link

BUG: RangeError: invalid array length #24

Closed kesylo closed 8 months ago

kesylo commented 8 months ago

Hello @farhoudshapouran I found this issue when using the library. I just discovered this component and it looks amazing. thanks for working on this. I followed your docs and the basic example but it crashes when you select a date.

To reproduce:

I checked the code a bit, it looks like it comes from the DaySelector function in the utils.ts file

Please if you could look at this, it will be very helpful to me.

Thanks

kesylo commented 8 months ago

By the way, I think the library is difficult to find on the web. I think it should have much more visibility

farhoudshapouran commented 8 months ago

Hi @kesylo I can't reproduce this error based on the basic example, but I'm trying to find what caused this error.

farhoudshapouran commented 8 months ago

By the way, I think the library is difficult to find on the web. I think it should have much more visibility

Thank you for your interest in the library, yes you are right I have to work much more on visibility 👀

kesylo commented 8 months ago

Thats weird. I'll try to check if its a problem on my project maybe ? even though I have a pretty basic project. this is the error I get:

ezgif com-video-to-gif

kesylo commented 8 months ago

Btw I'm also using expo

farhoudshapouran commented 8 months ago

Based on the error message, I found that this problem is about the time picker values, the values array must be checked before rendering, and I created a branch to fix it.

kesylo commented 8 months ago

Thanks for the quick fix but it caused another issue I think. Now this is what I get

image