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

Event indicator is sometimes not displayed. #340

Closed
KatrinLomp opened this issue Jun 21, 2016 · 7 comments
Closed

Event indicator is sometimes not displayed. #340

KatrinLomp opened this issue Jun 21, 2016 · 7 comments

Comments

@KatrinLomp
Copy link

When navigating between months, I sometimes don't see indicator on dates that should have events. I tried this on versions 2.2.0 and 2.1.1. With 2.1.1 I see indicator, but the color is not what I return in calendar:appearance:eventColorsForDate:. With 2.2.0 I don't see any indicator (maybe clear color is used?).

I tried to get an example to reproduce the problem. This is the setup, that currently reproduces the problem for me:

  • (NSInteger)calendar:(FSCalendar *)calendar numberOfEventsForDate:(NSDate *)date {
    NSCalendar *gregorian = [[NSCalendar alloc] initWithCalendarIdentifier:NSCalendarIdentifierGregorian];
    NSDateComponents *comp = [gregorian components:(NSCalendarUnitYear | NSCalendarUnitMonth | NSCalendarUnitDay) fromDate:date];
    if ((comp.year == 2016 && comp.month == 05 && comp.day == 26)
    || (comp.year == 2016 && comp.month == 06 && comp.day == 01)
    || (comp.year == 2016 && comp.month == 06 && comp.day == 23)
    || (comp.year == 2016 && comp.month == 06 && comp.day == 24)
    || (comp.year == 2016 && comp.month == 06 && comp.day == 25)
    || (comp.year == 2016 && comp.month == 07 && comp.day == 01)
    || (comp.year == 2016 && comp.month == 07 && comp.day == 07)
    || (comp.year == 2016 && comp.month == 07 && comp.day == 18)) {
    return 1;
    }

    return 0;
    }

  • (NSArray *)calendar:(FSCalendar *)calendar appearance:(FSCalendarAppearance *)appearance eventColorsForDate:(NSDate *)date {
    return @[[UIColor yellowColor]];
    }

I just switch between these months and sometimes indicator goes missing. I don't know if this matters, but I have a small delay before I load events for new month. I prepare events for new month while calendar animates from one month to another and once it's done animating, I reload calendar.

@WenchaoD
Copy link
Owner

Hi @KatrinLomp . Can u try the latest?

@KatrinLomp
Copy link
Author

I'm still able to reproduce it.

@WenchaoD
Copy link
Owner

Can u make a demo and share it.

@KatrinLomp
Copy link
Author

I created demo project here: https://github.com/KatrinLomp/EventIndicatorDemo
I was not able to reproduce it with default calendar appearance, so I made it match the setting I used in my app. For reproducing I first scroll forward to August and then go back to April. While scrolling back and forth between these, you should notice, that sometimes some indicators are not displayed.

@WenchaoD
Copy link
Owner

Thanks @KatrinLomp I'll check asap

WenchaoD added a commit that referenced this issue Jun 29, 2016
Fix problem #340
@WenchaoD
Copy link
Owner

Check again?

@KatrinLomp
Copy link
Author

Haven't been able to reproduce with latest code. Thank you for the fix!

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