Working with Calendar Exceptions

In project scheduling, calendar exceptions are essential for accurately reflecting non-working days, such as holidays, or modified working hours. Aspose.Tasks for .NET provides robust APIs to define, retrieve, and manage such exceptions in project calendars, enabling developers to build reliable scheduling solutions that align with real-world constraints.

This section covers the full range of calendar exception operations. Developers can add or remove exceptions from a calendar using the CalendarExceptionCollection class, specify working or non-working days, and configure recurrence patterns for repeated exceptions. Each exception is represented by the CalendarException class, which supports detailed settings such as start and end dates, working times, and weekday applicability.

By using Aspose.Tasks, exceptions can be configured programmatically with precision. For example, users can define recurring annual holidays or set specific working hours for a given date range. Additionally, developers can retrieve existing exceptions from a calendar to analyze or modify them as needed.

The library also allows fine-grained control over the weekdays to which an exception applies. This is particularly useful when defining complex calendars that differ from standard Monday–Friday workweeks. Combined with recurrence handling, this enables the modeling of advanced scheduling scenarios such as rotating shifts or partial closures.

Refer to the linked subtopics to learn how to perform each operation: adding/removing exceptions, retrieving defined exceptions, configuring applicable weekdays, and working with recurring patterns.

Working with Calendar Exceptions

Subscribe to Aspose Product Updates

Get monthly newsletters & offers directly delivered to your mailbox.