We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Everything works fine for current date but none of the events for other dates are displayed. My code:
- (NSArray *) calendarDayTimelineView:(TKCalendarDayView*)calendarDayTimeline eventsForDate:(NSDate *)eventDate{ NSLog(@"eventDate : %@",eventDate); NSDateFormatter *formatter = [NSDateFormatter new]; [formatter setDateFormat:@"yyyy-MM-dd"]; [formatter setLocale:[NSLocale systemLocale]]; NSString *dateString = @""; dateString = [formatter stringFromDate:eventDate]; NSMutableArray *arr = [[CommonModel shared] GetAllCustomerArticleDetailForDayCalendar:dateString]; NSDateComponents *info = [[NSDate date] dateComponentsWithTimeZone:calendarDayTimeline.calendar.timeZone]; info.second = 0; NSMutableArray *ret = [NSMutableArray array]; for(CustomerArticleDetail *detail in arr) { [formatter setDateFormat:@"yyyy-MM-dd'T'HH:mm:ss"]; NSDate *dateStart = [formatter dateFromString:detail.StartDate]; NSDate *dateEnd = [formatter dateFromString:detail.EndDate]; [formatter setDateFormat:@"yyyy-MM-dd'T'hh:mm:ss"]; NSString *start = [formatter stringFromDate:dateStart]; NSString *end = [formatter stringFromDate:dateEnd]; TKCalendarDayEventView *event = [calendarDayTimeline dequeueReusableEventView]; if(event == nil) event = [TKCalendarDayEventView eventView]; NSInteger col = arc4random_uniform(3); [event setColorType:col]; event.identifier = [NSNumber numberWithInt:detail.Id]; event.titleLabel.text = detail.CustomerName; event.locationLabel.text = detail.Article_Details; int hours = [[[[[start componentsSeparatedByString:@"T"] objectAtIndex:1] componentsSeparatedByString:@":"] objectAtIndex:0] intValue]; int minutes = [[[[[start componentsSeparatedByString:@"T"] objectAtIndex:1] componentsSeparatedByString:@":"] objectAtIndex:1] intValue]; info.hour = hours; info.minute = minutes; event.startDate = [NSDate dateWithDateComponents:info]; hours = [[[[[end componentsSeparatedByString:@"T"] objectAtIndex:1] componentsSeparatedByString:@":"] objectAtIndex:0] intValue]; minutes = [[[[[end componentsSeparatedByString:@"T"] objectAtIndex:1] componentsSeparatedByString:@":"] objectAtIndex:1] intValue]; info.hour = hours; info.minute = minutes; event.endDate = [NSDate dateWithDateComponents:info]; [ret addObject:event]; } return ret; }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Everything works fine for current date but none of the events for other dates are displayed. My code:
The text was updated successfully, but these errors were encountered: