Get next date of a reccurence

2 posts, 0 answers
  1. Shimon
    Shimon avatar
    18 posts
    Member since:
    Jul 2013

    Posted 25 Feb 2015 Link to this post


    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.
  2. Ivan Danchev
    Ivan Danchev avatar
    1301 posts

    Posted 27 Feb 2015 Link to this post


    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.

    Ivan Danchev

    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.

Back to Top