Hi
Actually I have multiple appointment for a day which will be for continuous for next 8-10 days.
Lets discuss this with one scenario. Suppose I have multiple appointments & one of appointment starts from 26Feb & ends on 5March. It shows coloured appointment view as strip for that span.
When I click on on starting date in month view it moves to day view & all appointments are shown in in that day as per specified color.
BUT when I click on 27Feb it doesn't show any appointment in day view & it replicates same till end date i.e 5 March.
Please share your thoughts on same.
Hi,
I wasn't able to reproduce this.
I tried a couple of different scenarios. One i created an appointment that was an ALL day Appt from Feb 26th - March 5th and the second was an appointment that wasn't all day but started Feb26th at 10am and end March 5th at 11 am. Both showed the appointment on every day between those 2 dates.
In the appointment request methods, are you returning that appointment for that particular day? I.e when appointments are requested for March 2nd by the dataSource are you returning that Feb 25th appointment? And if so, does it have the proper start and end day set?
-SteveZ
One more thing,
I did take a look at our samples browser and there was an error in calculating what appointments were being displayed. Perhaps thats the problem you were running into?
Here is a better code snippet, which verifies the end date is valid for displaying an appointment:
-(NSArray *)calendarView:(IGCalendarView *)calView appointmentsForStart:(NSDate *)start end:(NSDate *)end ofType:(IGCalendarAppointmentRequestType)requestType
{
NSTimeInterval min = [start timeIntervalSince1970];
NSTimeInterval max = [end timeIntervalSince1970];
NSMutableArray* returnAppts = [[NSMutableArray alloc]init];
for(NSDictionary* appt in _appts)
NSDate* startTime = appt[@"start"];
NSDate* endTime = appt[@"end"];
NSTimeInterval current = [startTime timeIntervalSince1970];
NSTimeInterval currentEnd = [endTime timeIntervalSince1970];
if((current >= min && current <= max) || (currentEnd >= min && currentEnd <= max) || (current <= min && currentEnd >= max) )
IGCalendarAppointment* calAppt = [[IGCalendarAppointment alloc]init];
calAppt.startTime = startTime;
calAppt.endTime = endTime;
calAppt.location = appt[@"location"];
calAppt.title = appt[@"title"];
[returnAppts addObject:calAppt];
}
return returnAppts;