-
Notifications
You must be signed in to change notification settings - Fork 12
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
Set a fixed number of weeks #6
Comments
There's no way (so far) to limit the number of weeks that are displayed, but we've had a similar use case where the app is mostly usable for a given time period, and what we did was this:
That way there's at least a visual indication whether you're within the date range that's covered and you don't need to scroll manually to find the start of that range. |
Well that's unfortunate ... perhaps it could be something that you'll look at adding in a future update.
I have been digging though your code and had a thought I'd like to run past you if you've got a minute. I noticed in your "ASWeekSelectorView.m" file that if I comment out the "if (offset.x >= width * 2 || offset.x <= 0)" statement within your "scrollViewDidScroll" method, it sort of works like I'm intending ... what happens is the calendar will only slide between the 3 different week frames and not even create the other weeks. When it gets to the end of the available weeks, it just bounces back. Perfect for what I've been trying to do.
What I'm wondering is if there was a way of setting up a parent conditional to that statement where if the earliest week (week0) displayed is greater than or equal to a new NSDate start week variable, and the last week (week2) displayed is less than or equal to a new NSDate end week variable, then slide accordingly between them. So, essentially I want to keep making that -7 or +7 offset until we get to a week that is beyond either of the two bookends. That way it wouldn't even draw the weeks outside of those parameters and just bounce.
Unfortunately I haven't get that pinned down yet, so any other suggestions would be greatly appreciated. Thanks again for any insights you have the time to share.
…-----Original Message-----
From: "Adrian Schoenig" <[email protected]>
Sent: Thursday, January 5, 2017 7:21pm
To: "nighthawk/ASWeekSelectorView" <[email protected]>
Cc: "pscarnegie" <[email protected]>, "Author" <[email protected]>
Subject: Re: [nighthawk/ASWeekSelectorView] Set a fixed number of weeks (#6)
There's no way (so far) to limit the number of weeks that are displayed, but we've had a similar use case where the app is mostly usable for a given time period, and what we did was this:
Initialise selectedDate to the start date of that date range (at least if it's after "today")
Implement the weekSelector: numberColorForDate: delegate and return grey for dates outside that time range.
That way there's at least a visual indication whether you're within the date range that's covered and you don't need to scroll manually to find the start of that range.
—
You are receiving this because you authored the thread.
Reply to this email directly, [ view it on GitHub ]( #6 (comment) ), or [ mute the thread ]( https://github.com/notifications/unsubscribe-auth/AF7d0Z7w_p_7ErEGO8E9wMjtQTExX6yYks5rPYj6gaJpZM4Lb-7I ).
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is there a way where you can set a fixed number of weeks available to display. For example, if I only want to be able to display the four weeks of February, and the current date is November, I'd have to scroll all the way back to February when launched. Can I set a start and stop date for display updates?
The text was updated successfully, but these errors were encountered: