Hello, I have a problem with the function Datamanager.GetActivities.The problem occurs only with recurring appointments. I create the following series • IsTimeZoneNeutral = True • FREQ = DAILY; INTERVAL = 1, COUNT = 10; WKST = MO GetActivities gives me two results on the first day
and the last day of the series no result.
I plan all the dates separately delivered correctly by GetActivities. Thanks for your support
Hello Marcus,
Thank you for your post. I have been looking into the issue that you have described and I could not managed to reproduce it. I have created a sample application that contains a XamOutlookCalendarView with recurrent appointment which occurs every day in a period of 10 days. When I call the GetActivities method and pass the range of the days that contains the recurrent appointments, all 10 appointments are returned form the method. I have tested the sample application using the RTM and the latest service release of version 12.2, with the same result.
Would you please tell me if you can reproduce the issue using my sample application and if not, would you please modify my sample to show the issue, in order to be able to provide you with more accurate assistance on the matter?
Looking forward to hearing from you.
Sincerely,
Krasimir
Developer Support Engineer
Infragistics
www.infragistics.com/support
Hello Krasimir,
I changed the example.
It's about the first day or the last day of the series.In the program for the first day, two Appointments in the return of the function.
Thank You
After further investigated this behavior and also contacted our Development Team regarding it and it seems that actually, you need to pass the universal time to the ActivityQuery, since the XamScheduleDataManager is not aware in which time zone you are making the request, so the DateRange is expecting a UTC time.
Please let me know if you need any further assistance on the matter.
Hello Krasimir
I modified the example again.Please look at the issue ... now the next day, two Activities displayed.
The range you are passing is in a 0 minute range starting at midnight (e.g. Monday 1/21/2013 00:00:00). The query manager returns all activities that intersect with this time. In your case you have 2 day long activities so one goes from Sunday 1/20/2013 00:00:00 to Monday 1/21/2013 00:00:00 and another goes from Monday 1/21/2013 00:00:00 to Tuesday 1/21/2013 00:00:00. Since you have 2 activities that intersect with Monday 1/21/2013 00:00:00 you get 2 results. Now the display/view controls treat the end date as exclusive (unless the activity is a 0 minute activity) so the view would skip that activity but the query result doesn't assume that so you get both. If you want to ignore the end time as well then you might do something like:
var localRange = new Infragistics.DateRange( d1 );var utcRange = new DateRange( localRange.Start.ToUniversalTime(), localRange.End.ToUniversalTime() );var result = dataManager.GetActivities(new ActivityQuery( ActivityTypes.Appointment, utcRange, calendars[0]));var localToken = dataManager.DataConnector.TimeZoneInfoProviderResolved.LocalToken;string activities = "";int i = 1;foreach (Appointment app in result.Activities){ if ( app.GetEndLocal( localToken ) == localRange.Start && app.Start != app.End ) continue;
Hallo Andrew,
thanks for the quick replay.
Please please change the method used in the example AddDays 2days then only one activity displayed.that would have to be linear behavior
Thank you.
I see. The logic must be including the initial activity if it intersects since this only happens with the first day. We can look at changing this but the modification I suggested would deal with it without any adverse affects. i.e.
private void button1_Click(object sender, RoutedEventArgs e) { var d = DateTime.Now.AddDays(2); var d1 = new DateTime(d.Year, d.Month, d.Day, 0, 0, 0); var d2 = new DateTime(d.Year, d.Month, d.Day, 23, 59, 59); var localRange = new Infragistics.DateRange( d1 ); var result = dataManager.GetActivities(new ActivityQuery( ActivityTypes.Appointment, new DateRange( localRange.Start.ToUniversalTime(), localRange.End.ToUniversalTime() ), calendars[0])); var localToken = dataManager.DataConnector.TimeZoneInfoProviderResolved.LocalToken; string activities = ""; int i = 1; foreach (Appointment app in result.Activities) { if ( app.GetEndLocal( localToken ) == localRange.Start && app.Start != app.End ) continue; activities += i + ": " + app.Subject + "\n"; i++; } Console.WriteLine(activities); localRange = new DateRange( d1, d2 ); result = dataManager.GetActivities(new ActivityQuery( ActivityTypes.Appointment, new DateRange( localRange.Start.ToUniversalTime(), localRange.End.ToUniversalTime() ), calendars[0])); activities = ""; i = 1; foreach (Appointment app in result.Activities) { if ( app.GetEndLocal( localToken ) == localRange.Start && app.Start != app.End ) continue; activities += i + ": " + app.Subject + "\n"; i++; } Console.WriteLine(activities); }