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

How to: enable load previous days? #21

Open
mineshpurohit opened this issue Nov 28, 2016 · 14 comments
Open

How to: enable load previous days? #21

mineshpurohit opened this issue Nov 28, 2016 · 14 comments

Comments

@mineshpurohit
Copy link

As I am working on this library in one of my project.

But I did try to include loading previous days from current days. But not able to load the days.

So can you please help me out.

Thanks.

@BadChoice
Copy link
Owner

You just need to inhert the weekview and update the "groupEventsByDay" function providing there all the days you want to show

@BadChoice BadChoice changed the title How to enable load previous days? How to: enable load previous days? Dec 12, 2016
@rpatechnology
Copy link

I'm having the same issue. I'm a little confused as to how to do what you're saying exactly. I'm unclear what the groupEventsByDays does? Thanks

@BadChoice
Copy link
Owner

in th egroupEventsByDays you need to return a dictionary where the key is the day and the values are the events so for example

"2016-12-12" : [ event1, event2, event3],
"2016-12-13" : [ event4, event5..]

@rpatechnology
Copy link

How do I enable it to scroll infinitely in either direction, whether there are events scheduled or not? Right now it only starts on the first event, and you can't scroll past the last one. I want to be able to create new events past the last scheduled event date, and also look back at past events. Thanks!

@BadChoice
Copy link
Owner

If you take a look at the infiniteScrollDecorator you will see the action that is called to reload dates (add the new ones) you can do the same but when scrolling in the other direction,

Please, if you do this send me a PR so I can merge with the original lib, I think it can be a good addition,

I'm a bit busy these days in another project so I don't have time to add it myself..
Let me know,

@rpatechnology
Copy link

Looks like infinite scrolling forward was simply just a matter of returning NO in newDaysLoaded when there are no events. Going reverse is trickier. I was able to get the days to load when scrolling backward. The problem is that when you call reload, the view scrolls to the beginning. So if 12/1 is the first day and you scroll left, it will load the 30 days before, but jump to 11/1. Do I have to mess with the contentOffset after the reload is complete, or is there an easier way?

@BadChoice
Copy link
Owner

BadChoice commented Dec 15, 2016 via email

@rpatechnology
Copy link

I couldn't find anything like that. Is scrolling going to be the best approach here?

@BadChoice
Copy link
Owner

BadChoice commented Dec 15, 2016 via email

@rpatechnology
Copy link

When I scroll left past the first date, I want it to keep loading past dates even if there are no events, like it does when you scroll past the last date. I'm able to get the dates to load, but when you load a new set of dates before the first one, it scrolls to the first new date. I want the scroll position to stay on the first date and resume scrolling left. I basically want it to work like the Apple calendar does.

@rutmb
Copy link

rutmb commented Dec 26, 2016

electrobank, Can you write what function did you change to make infinite reverse scrolling?

@rutmb
Copy link

rutmb commented Feb 22, 2017

BadChoice,
Do you know how to make infinite reverse scrolling?
Do you know how to reload week view if user chose the different months?

@Echoecho126
Copy link

Echoecho126 commented Apr 24, 2017

Hi,
I'm having the same issue. I'm confused as to how to do what you're saying exactly. At first,I try to caculate previous dates like loadNextDays when scroll to the other direction,but it doesn't work. The first day is still Today. Then, i don't know where to implement the method " groupEventsByDays" . Last, i have similar questions you talked about before. Maybe the best solution is you solving them in your demo. would you like to solve them in your demo ? Thank you .

@BadChoice
Copy link
Owner

There is a fork where somebody solved it I think,
I'll take a look and see if It is well done and I can merge it into this one

@carotorrehdz
Copy link

@BadChoice did you had the chance to look at that fork? or can you share who solved it?

@BadChoice
Copy link
Owner

I didn't look at it yet, if you want to try to solve it it will be really appreciated

@marco-ni
Copy link

marco-ni commented Mar 2, 2018

Any news about infinite backward scrolling ?

@BadChoice
Copy link
Owner

Nope, I haven't worked on it yet

@nivritgupta
Copy link

@BadChoice @mineshpurohit @rutmb @Echoecho126 @carotorrehdz anyone has update regarding infinite backward scrolling ?

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

8 participants