This is a migrated thread and some comments may be shown as answers.

Get next date of a reccurence

1 Answer 25 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Shimon
Top achievements
Rank 2
Shimon asked on 25 Feb 2015, 10:55 AM
Hello,

I would like to know if it is possible to get the next date(s) of a recurring event.

Example : A event start 2015/02/28 and repeat all day, so GetNextDate() will give me 2015/02/29.

Thank you, Shimon.

1 Answer, 1 is accepted

Sort by
0
Ivan Danchev
Telerik team
answered on 27 Feb 2015, 04:05 PM
Hello,

You can get each occurrence in a recurring appointment through the Occurrences property which returns a collection of all the occurrences defined by the Recurrence rule. The following code shows how to get the occurrences from an instance of an appointment and store it into an IEnumerable collection:
Appointment app = new Appointment();
RecurrenceRule parsedRule;
RecurrenceRule.TryParse(app.RecurrenceRule, out parsedRule);
 
IEnumerable<DateTime> occurrence = parsedRule.Occurrences;

You can find more information about the Occurrences property and about the Appointment class in our Working with Recurring Appointments documentation article.

Regards,
Ivan Danchev
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Scheduler
Asked by
Shimon
Top achievements
Rank 2
Answers by
Ivan Danchev
Telerik team
Share this question
or