Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scrollerPaging. The strip spins on 6 days for the first time, then – on 7 days #269

Closed
artcherenkov opened this issue Feb 7, 2021 · 8 comments

Comments

@artcherenkov
Copy link

artcherenkov commented Feb 7, 2021

If the week starts on Monday, I want the bar to scroll until the next or previous Monday, but for some reason, when the first scroll, the bar spins for 6 days, and then properly - for 7 days.

My config:

<CalendarStrip
  scrollable
  scrollerPaging
  style={{ height: 200, paddingTop: 20, paddingBottom: 10 }}
  calendarColor={'#3343ce'}
  iconContainer={{ flex: 0.1 }}
/>

ezgif com-gif-maker

Someone know, how to fix it?

@Andrerm124
Copy link

I'm also facing this issue. Not sure on the cause but it makes the app look a little confusing at times.

@peacechen
Copy link
Collaborator

This may be a bug in the scrolling algorithm. Please use the demo project in this repo to debug and submit a PR.

https://github.com/BugiDev/react-native-calendar-strip#development-with-sample-application

@peacechen
Copy link
Collaborator

This has been published in 2.2.0

Thanks @psolom for the PR

@ozanmanav
Copy link
Contributor

@peacechen Same issue happening on master branch. I'm setting starting of date as Monday. But it is again changing to Sunday when we scroll to next week.

@psolom
Copy link
Contributor

psolom commented Apr 24, 2021

@ozanmanav Make sure you set minDate and maxDate params, and the difference between values is a multiple of 7 - number of days in a week (14, 21, 28, etc). Works for me in versions of 2.2.0+

@ozanmanav
Copy link
Contributor

@psolom Thanks for answer. Can you share a piece of code for this situation? In my case, it starts with Monday when it doesn't scroll at all, but when it scrolls it always becomes Sunday on the first day.
The props I am currently using for this are as follows.

  const startingDate = 2021-04-19

    scrollable = {true}
    scrollerPaging = {true}
    useIsoWeekday = {false}
    startingDate = {startingDate}

The first view is as follows:
image

But if I scroll it works like this:
image

@ozanmanav
Copy link
Contributor

ozanmanav commented Apr 24, 2021

I think I found the problem. This problem happens when I close the left selector and right selector. When you open them, the problem disappears. I guess there is actually a little slip.

I made an issue about this: #291

@rjuevesano
Copy link
Contributor

@ozanmanav try this solution on this issue #266

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants