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

Conflict with shouldSelectDate delegate call on future month #35

Closed
jjknudsen opened this issue Jun 27, 2015 · 7 comments
Closed

Conflict with shouldSelectDate delegate call on future month #35

jjknudsen opened this issue Jun 27, 2015 · 7 comments

Comments

@jjknudsen
Copy link

First of all let me say I love this control. Very well done. Best I've seen of the dozens of calendar controls out there.

I have implemented the calendar:shouldSelectDate delegate callback to prevent the user from selecting a date before today. The issue I'm having is that when the user selects one of placeholder cells for the next month, the delegate callback is not passing in the correct date.

So, for example, given the month of June 2015, if the user selects the placeholder cell for July 1, I would expect the calendar to animate to the new month. However, what is happening is the wrong date is being sent to the delegate callback (it's actually sending June 3) which then causes my callback to return NO and the calendar never animates to the new month.

I'm hoping I'm being clear. Let me know if you have any questions. Thanks again!

@WenchaoD
Copy link
Owner

Try 0.8.1?

@jjknudsen
Copy link
Author

Still having the problem in 0.8.1.

@WenchaoD
Copy link
Owner

You sure? It works fine in the example.

@jjknudsen
Copy link
Author

OK, I think I figured out what I did to cause the behavior. In your example code, I updated the code in StoryboardExampleViewController.m to include the following datasource callback.

- (NSDate *)minimumDateForCalendar:(FSCalendar *)calendar
{
    return [NSDate date];
}

When I add this callback, the behavior I discuss above occurs.

@WenchaoD
Copy link
Owner

And what's the maximumDate?

@WenchaoD
Copy link
Owner

OK, that's how to make it work - make sure the minimumDate is the first day of month, and the maximumDate the last. I should've made it clear in Readme.Will fix it inside in next release.

Thanks ~

@jjknudsen
Copy link
Author

I didn't have a maximum date but what you're saying makes sense. Thanks for the help!

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

2 participants