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

Modified didSelectDate method to receive dateItem. #61

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions Examples/Calendar/CKViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,9 @@ - (BOOL)calendar:(CKCalendarView *)calendar willSelectDate:(NSDate *)date {
return ![self dateIsDisabled:date];
}

- (void)calendar:(CKCalendarView *)calendar didSelectDate:(NSDate *)date {
- (void)calendar:(CKCalendarView *)calendar didSelectDate:(NSDate *)date withDateItem:(CKDateItem *) dateItem {
self.dateLabel.text = [self.dateFormatter stringFromDate:date];
dateItem.backgroundColor = [UIColor greenColor];
}

- (BOOL)calendar:(CKCalendarView *)calendar willChangeToMonth:(NSDate *)date {
Expand All @@ -118,4 +119,4 @@ - (void)calendar:(CKCalendarView *)calendar didLayoutInRect:(CGRect)frame {
NSLog(@"calendar layout: %@", NSStringFromCGRect(frame));
}

@end
@end
4 changes: 2 additions & 2 deletions Source/CKCalendarView.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ typedef enum {
@optional
- (void)calendar:(CKCalendarView *)calendar configureDateItem:(CKDateItem *)dateItem forDate:(NSDate *)date;
- (BOOL)calendar:(CKCalendarView *)calendar willSelectDate:(NSDate *)date;
- (void)calendar:(CKCalendarView *)calendar didSelectDate:(NSDate *)date;
- (void)calendar:(CKCalendarView *)calendar didSelectDate:(NSDate *)date withDateItem:(CKDateItem *)dateItem;
- (BOOL)calendar:(CKCalendarView *)calendar willDeselectDate:(NSDate *)date;
- (void)calendar:(CKCalendarView *)calendar didDeselectDate:(NSDate *)date;

Expand All @@ -81,4 +81,4 @@ typedef enum {

- (void)calendar:(CKCalendarView *)calendar didLayoutInRect:(CGRect)frame;

@end
@end
4 changes: 2 additions & 2 deletions Source/CKCalendarView.m
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@ - (void)_dateButtonPressed:(id)sender {
}

[self selectDate:date makeVisible:YES];
[self.delegate calendar:self didSelectDate:date];
[self.delegate calendar:self didSelectDate:date withDateItem:dateButton.dateItem];
[self setNeedsLayout];
}

Expand Down Expand Up @@ -652,4 +652,4 @@ + (UIImage *)_imageNamed:(NSString *)name withColor:(UIColor *)color {
return coloredImg;
}

@end
@end