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

Feature Request: Method to change the dot color #49

Closed
bci opened this issue Jun 10, 2014 · 10 comments
Closed

Feature Request: Method to change the dot color #49

bci opened this issue Jun 10, 2014 · 10 comments

Comments

@bci
Copy link

bci commented Jun 10, 2014

Can be part of CKCalendarDataSource.h:

- (UIColor *)calendarView:(CKCalendarView *)calendarView dotColorForDate:(NSDate *)date;

I'll try this (and maybe calendarView:labelColorForDate, and calendarView:backgroundColorForDate), I need to learn more ;) I'm just afraid the code will not be as clean...

@MosheBerman
Copy link
Owner

Hey, there's already a better way to do this. ;-)

Import the CKCalendarCell header class. Then, use UIAppearance to change the dotColor property.

@MosheBerman
Copy link
Owner

I do wonder though, perhaps exposing that through the calendar view data source is a good idea.

@bci
Copy link
Author

bci commented Jun 11, 2014

But that looks like it will set the color for all dots. Not just the dot for that date...
I.e.:
2014-06-10 will have a blue dot
2014-06-12 will have a red dot
2014-06-14 will have a green dot

@MosheBerman
Copy link
Owner

Ah, I see. That's interesting...

@MosheBerman
Copy link
Owner

What do you think about a datasource method like -(UIColor *) calendarView:(CKCalendarView*)calendar colorForDotOnDate:(NSDate*)date?

@bci
Copy link
Author

bci commented Jul 29, 2014

That would be perfect ;) I don't see it returning a UIColor object there, but you have something planned, I bet.

@Beisenbek
Copy link

What about possibility of the changing color for a cell? i.e: -(void) calendarView:(CKCalendarView_)calendar colorForCellOnDate:(NSDate_)date?

@MosheBerman
Copy link
Owner

@bci, good catch about returning a color, fixed.

@Beisenbek, we can do that too, but I think it makes sense to use UIAppearance, to enforce consistent colors across all cells.

@jarrillaga
Copy link

Hi Moshe, the calendar that I need to implement must deal with two types of events. For one I have to paint the cell with a color and for the other I need another color. How can I change the cells colors? Thanks, I really appreciate all your work

@MosheBerman
Copy link
Owner

MBCalendarKit 5.0.0 allows for a lot more customization with the cells. Check out the Custom Cell Provider section of the updated readme for more. Since this issue is really old, I'm going to close it. Feel free to comment here with more thoughts, or open a new issue.

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

4 participants