BugiDev / react-native-calendar-strip

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

Right arrow shows despite maxDate being visible #206

Closed VanessaChu closed 4 years ago

VanessaChu commented 4 years ago

Video: https://www.amazon.com/photos/shared/fJtR2to7RVKSToW1drlRmQ.VL6eBP55mDqZO2gmwq_3Gl As shown in the video, I have set the maxDate to July 1. Even though July 1 is part of the visible dates, the right arrow is still visible. Is there a way to hide it somehow if there are no next days to scroll to?

            <View style={{ flex: 1 }} >
                <CalendarStrip
                    scrollable
                    style={{ height: 100 }}
                    showMonth={false}
                    maxDate={moment()}
                    minDate={moment().subtract(28, 'days')}
                    startingDate={moment(selectedDate).subtract(6, 'days')}
                    selectedDate={selectedDate}
                    onDateSelected={this.onDateSelected}
                    highlightDateNumberStyle={{ color: 'blue' }}
                    highlightDateNameStyle={{ color: 'blue' }}
                    iconContainer={{ padding: 10 }}
                />
            </View>
peacechen commented 4 years ago

This was fixed in 51867db83d47910f694db856291ce30add0fb97e. Until a new version is published, you can point to directly to this repo to use the latest code.

VanessaChu commented 4 years ago

My dependency points to this latest code - it is not fixed

peacechen commented 4 years ago

npm often has problems with caching when pulling from a Github repo. Use these steps to clear the cache:

  1. Delete node_modules.
  2. npm install
  3. npm start -- --reset-cache
  4. Break out of that after it starts the packager: Ctrl-C.
  5. Start the app with npm start (or react-native run-... for native projects).

The --reset-cache flag requires @react-native-community/cli-tools:

npm install @react-native-community/cli-tools --global

VanessaChu commented 4 years ago

I'm sure it's not cached because I looked at the source code to make sure the changes in that commit was reflected

peacechen commented 4 years ago

While node_modules may contain the new code, the packager can still internally fetch from the cache and build from the old code. I recommend that you try resetting the npm cache.

peacechen commented 4 years ago

The fix has been published in 2.0.7