search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

Remove recurrence exception in scheduler

Asked by Diederik
12 years ago.

I have a recurrent event and an exception in one of the occurrences (other starttime). For the exception, I created an exception record with "RecurrenceRule.EncodeExceptionModified(e.RecurrentMasterId, e.OldStart)". Later on, I want to delete this occurrence. Now I have to create a record with "RecurrenceRule.EncodeExceptionDeleted(e.RecurrentMasterId, Start)". How do I get the correct value for Start, when this is a moved occurrence? It seems to be the original starttime of the occurence.

Answer posted by Dan Letecky [DayPilot]
12 years ago.

You can extract the original start date from the recurrence string using RecurrenceRule.DecodeStart():

DateTime originalStart = RecurrenceRule.DecodeStart(recurrenceString);

There are also other helper methods in RecurrenceRule class that may come handy, e.g. RecurrenceRule.Prefix(masterId) will return the recurrence rule string prefix that is shared by all exceptions for a given master id.

You can see it in action in the source code of the following tutorial:

http://code.daypilot.org/34377/shift-scheduling-tutorial-asp-net-sql-server-c-vb-net

This question is more than 1 months old and has been closed. Please create a new question if you have anything to add.