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

Calendar Date Issue #2

Closed
girishnair12345 opened this issue Jul 7, 2014 · 8 comments
Closed

Calendar Date Issue #2

girishnair12345 opened this issue Jul 7, 2014 · 8 comments

Comments

@girishnair12345
Copy link

There is a problem in which date is written in your library, it shows differently when I scroll and differently when I double tap and go inside the month view

When I run it after installation and swipe to say November of 2014 then day 1 starts at saturday but if I run it again and then double tap the month to get the list of month and double tap november then day 1 starts on Tuesday.

I am using a different view controller to show the Calendar and when I press the back button I get this error too

-[__NSCFCalendar components:fromDate:]: date cannot be nil
I mean really, what do you think that operation is supposed to mean with a nil date?
An exception has been avoided for now.
A few of these errors are going to be reported with this complaint, then further violations will simply silently do whatever random thing results from the nil.
Here is the backtrace where this occurred this time (some frames may be missing due to compiler optimizations):

Can you also add some swipe gesture of left or right motion other than fading effect

@girishnair12345
Copy link
Author

In the - (void)doubleTap:(UITapGestureRecognizer *)recognizer I have added the lines
if (type == CTDay) {
[self generateDayRects];
}
just before the method ends and now the start day shows properly, let me know if this way is correct or not

maximbilan added a commit that referenced this issue Jul 7, 2014
…n it after installation and swipe to say November of 2014 then day 1 starts at saturday but if I run it again and then double tap the month to get the list of month and double tap november then day 1 starts on Tuesday..."
@maximbilan
Copy link
Owner

Thank you for posting the issue. Yes, you're right, it's correct way. I've already pushed commit.

@maximbilan
Copy link
Owner

About fade effect, unfortunately this component has only one animation effect, because for me I didn't need to other effects. I think adding of new animation effect will not be difficult for you. If you have any questions, I'll be glad to help.

@girishnair12345
Copy link
Author

Ya forgot to mention this error was thrown each time i go back from the viewcontroller containing the calendar

"date cannot be nil
I mean really, what do you think that operation is supposed to mean with a nil date?
An exception has been avoided for now.
A few of these errors are going to be reported with this complaint, then further violations will simply silently do whatever random thing results from the nil.
Here is the backtrace where this occurred this time (some frames may be missing due to compiler optimisations):"

I have corrected the issue by change the line like this in setCurrentDate method in the CalendarView.m file

  • (void)setCurrentDate:(NSDate *)currentDate
    {
    if (currentDate == nil) {
    return;
    }
    .....

Let me also know if this was the correct approach

@maximbilan
Copy link
Owner

Yes, it's correct approach. Ok, I'll push this fix. Sorry, I haven't time for now to thoroughly investigate, and actually don't understand in what cases currentDate can be nil.

@maximbilan
Copy link
Owner

Ok, I understand, if set current date from view controller and transfer nil. Yes, you're right.

@maximbilan
Copy link
Owner

Thank you for posting and resolving bugs.

@girishnair12345
Copy link
Author

Welcome, thank you for creating such a good library :)

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