Skip to main content

TimeRegion.ExceptionDates Property

Gets or sets the list of dates free of this recurring time region.

Namespace: DevExpress.XtraScheduler

Assembly: DevExpress.XtraScheduler.v24.1.dll

NuGet Package: DevExpress.Win.Scheduler

Declaration

public IList<DateTime> ExceptionDates { get; set; }

Property Value

Type Description
IList<DateTime>

The List of dates that do not display this recurring time region.

Remarks

When you specify the time region recurrence pattern (see the TimeRegion.Recurrence property), you can add specific dates to the ExceptionDates collection to remove the time region from these dates.

In the code below, the timeRegion1 repeats every work day and lasts for 1 hour starting from 1p.m. This region does not appear at March 21, 2019 because this date is added to the ExceptionDates list.

DateTime baseDate = DateTimeHelper.GetStartOfWeek(DateTime.Today);
baseDate = baseDate.AddDays(-15);

//Region #1 - 1p.m. to 2p.m., repeats every work day
TimeRegion timeRegion1 = new TimeRegion();
timeRegion1.Start = baseDate.AddHours(13);
timeRegion1.End = baseDate.AddHours(14);
timeRegion1.Editable = false;
timeRegion1.Recurrence = new RecurrenceInfo();
timeRegion1.Recurrence.Start = timeRegion1.Start;
timeRegion1.Recurrence.Type = RecurrenceType.Weekly;
timeRegion1.Recurrence.WeekDays = WeekDays.WorkDays;
timeRegion1.ExceptionDates.Add(new DateTime(2019, 3, 21, 13, 0, 0));
scheduler.TimeRegions.Add(timeRegion1);
See Also