BugiDev / react-native-calendar-strip

Easy to use and visually stunning calendar component for React Native.
MIT License
936 stars 325 forks source link

Support updateWeekView() when scroller enabled #247

Closed csetiawan closed 3 years ago

csetiawan commented 3 years ago

Implementing updateWeekView() when scroller enabled as mentioned at #241. Also updating the TS def to reflect the latest updateWeekView()

peacechen commented 3 years ago

Thanks @csetiawan ! This looks good. Does this need any more testing?

csetiawan commented 3 years ago

For some reason, I can't get the test working with Jest. It's complaining about Preset react-native not found. Otherwise, I've tested this feature manually and it worked great on my project. BTW, how often do you release another build? Thanks!

csetiawan commented 3 years ago

@peacechen, I've added a rudimentary unit test for Scroller and upgraded Jest in order to get the testing working on my machine.

peacechen commented 3 years ago

Thanks @csetiawan Does the change in .babelrc to "module:metro-react-native-babel-preset" affect consumers of this library? Or does that only affect local testing and sample project? Please confirm that the sample project continues to run properly.

Regarding my comment above about minDate & maxDate, I think it would be better if the scroller moved to maxDate if the given date exceeds it, or to minDate if the given date precedes that. A no-op is more confusing to users who don't see any effect if their date is outside the bounds. Alternatively, issue a yellow box warning for the out-of-bounds conditions.

csetiawan commented 3 years ago

@peacechen, I've just confirmed that the example works as expected. I'm pretty sure that .babelrc is only for jest and no transformation needed for the source code anyway. Also, I've updated the code to follow your suggestions on min/max date fallback.

peacechen commented 3 years ago

Thanks for authoring and updating this PR 👍