# ProjectCalendar

A base or derived calendar with stored working days and exceptions; no scheduling runs during editing.

Class 

`OfficeIMO.Project`

**Namespace**

`OfficeIMO.Project`

**Assembly**

`OfficeIMO.Project`

**Source revision**

`ba882f6b0d07` with working tree changes

**Source**

[ProjectCalendar.cs:40](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Project/Model/ProjectCalendar.cs#L40)

**Base**

`ProjectNamedEntity`

**Modifiers**

sealed

A base or derived calendar with stored working days and exceptions; no scheduling runs during editing.

## Inheritance

- [ProjectObject](/api/project/officeimo-project-projectobject/)
- [ProjectEntity](/api/project/officeimo-project-projectentity/)
- [ProjectNamedEntity](/api/project/officeimo-project-projectnamedentity/)
- ProjectCalendar

## Usage

Explore 15 API references to this type

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

### Returned or exposed by 10

- Property [ProjectCalendar.BaseCalendar](/api/project/officeimo-project-projectcalendar/#property-basecalendar)
- Method [ProjectCalendarCollection.Add](/api/project/officeimo-project-projectcalendarcollection/#method-add-string-officeimo-project-projectcalendar)
- Method [ProjectCalendarCollection.AddStandardWorkingWeek](/api/project/officeimo-project-projectcalendarcollection/#method-addstandardworkingweek-string)
- Method [ProjectCalendarCollection.GetByUid](/api/project/officeimo-project-projectcalendarcollection/#method-getbyuid-int32)
- Method [ProjectCalendarCollection.GetEnumerator](/api/project/officeimo-project-projectcalendarcollection/#method-getenumerator)
- Property [ProjectCalendarCollection.Item](/api/project/officeimo-project-projectcalendarcollection/#property-item-int32)
- Property [ProjectDocument.Calendar](/api/project/officeimo-project-projectdocument/#property-calendar)
- Property [ProjectResource.Calendar](/api/project/officeimo-project-projectresource/#property-calendar)
- Property [ProjectSettings.Calendar](/api/project/officeimo-project-projectsettings/#property-calendar)
- Property [ProjectTask.Calendar](/api/project/officeimo-project-projecttask/#property-calendar)

### Accepted by parameters 5

- Method [ProjectCalendarCollection.Add](/api/project/officeimo-project-projectcalendarcollection/#method-add-string-officeimo-project-projectcalendar) parameter `baseCalendar`
- Method [ProjectCalendarCollection.Remove](/api/project/officeimo-project-projectcalendarcollection/#method-remove-officeimo-project-projectcalendar) parameter `calendar`
- Method [ProjectDocument.AddRecurringTask](/api/project/officeimo-project-projectdocument/#method-addrecurringtask-string-collections-generic-ienumerable-system-datetime-officeimo-project-projectduration-officeimo-project-projecttask-officeimo-project-projectcalendar-int32-threading-cancellationtoken) parameter `calendar`
- Method [ProjectResource.SetCalendar](/api/project/officeimo-project-projectresource/#method-setcalendar-officeimo-project-projectcalendar) parameter `value`
- Method [ProjectTask.SetCalendar](/api/project/officeimo-project-projecttask/#method-setcalendar-officeimo-project-projectcalendar) parameter `value`

Filter members 

Show inherited

## Methods

`public DateTime AddWorkingMinutes(DateTime start, decimal minutes, int maxCalendarDays = 36600, CancellationToken cancellationToken = default)` [#](#method-addworkingminutes-datetime-decimal-int32-threading-cancellationtoken)

[ProjectCalendarMath.cs:19](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Project/Scheduling/ProjectCalendarMath.cs#L19)

Adds signed working minutes, skipping non-working intervals. Uses local wall time without host timezone or DST conversion.

Parameters

**start System.DateTime required**

**minutes decimal required**

**maxCalendarDays int = 36600 optional**

**cancellationToken System.Threading.CancellationToken = default optional**

Returns

`DateTime`

`public IReadOnlyList<ProjectWorkingRange> GetWorkingIntervals(DateTime date, CancellationToken cancellationToken = default)` [#](#method-getworkingintervals-datetime-threading-cancellationtoken)

[ProjectCalendarMath.cs:15](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Project/Scheduling/ProjectCalendarMath.cs#L15)

Returns effective intervals within one local date, including an overnight shift started the preceding day.

Parameters

**date System.DateTime required**

**cancellationToken System.Threading.CancellationToken = default optional**

Returns

`IReadOnlyList<ProjectWorkingRange>`

`public ProjectWeekDay SetWorkingDay(DayOfWeek day, params ProjectWorkingTime[] times)` [#](#method-setworkingday-dayofweek-officeimo-project-projectworkingtime)

[ProjectCalendar.cs:40](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Project/Model/ProjectCalendar.cs#L40)

Replaces the working intervals for a day without changing other calendar days.

Parameters

**day System.DayOfWeek required**

**times OfficeIMO.Project.ProjectWorkingTime[] required**

Returns

`ProjectWeekDay`

`public decimal WorkingMinutesBetween(DateTime start, DateTime finish, int maxCalendarDays = 36600, CancellationToken cancellationToken = default)` [#](#method-workingminutesbetween-datetime-datetime-int32-threading-cancellationtoken)

[ProjectCalendarMath.cs:23](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Project/Scheduling/ProjectCalendarMath.cs#L23)

Counts signed working minutes between local dates. Split shifts are counted once, even when intervals overlap.

Parameters

**start System.DateTime required**

**finish System.DateTime required**

**maxCalendarDays int = 36600 optional**

**cancellationToken System.Threading.CancellationToken = default optional**

Returns

`decimal`

## Inherited Methods

`public virtual bool Equals(object? obj)` [#](#method-equals-object)

Inherited from object

Parameters

**obj object? required**

Returns

`bool`

`public virtual int GetHashCode()` [#](#method-gethashcode)

Inherited from object

Returns

`int`

`public Type GetType()` [#](#method-gettype)

Inherited from object

Returns

`Type`

`public virtual string? ToString()` [#](#method-tostring)

Inherited from object

Returns

`string?`

## Properties

`public ProjectCalendar? BaseCalendar { get; set; }` [#](#property-basecalendar)

[ProjectCalendar.cs:13](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Project/Model/ProjectCalendar.cs#L13)

The inherited calendar, or null for a base calendar.

`public bool? IsBaseCalendar { get; set; }` [#](#property-isbasecalendar)

[ProjectCalendar.cs:24](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Project/Model/ProjectCalendar.cs#L24)

Source base-calendar flag; null preserves absence.

`public ProjectCollection<ProjectWeekDay> WeekDays { get; }` [#](#property-weekdays)

[ProjectCalendar.cs:32](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Project/Model/ProjectCalendar.cs#L32)

Explicit day-of-week declarations; absent days may be inherited.

`public ProjectCollection<ProjectCalendarException> Exceptions { get; }` [#](#property-exceptions)

[ProjectCalendar.cs:34](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Project/Model/ProjectCalendar.cs#L34)

Date exceptions, including retained unmodeled recurrence data.

`public ProjectCollection<ProjectWorkWeek> WorkWeeks { get; }` [#](#property-workweeks)

[ProjectCalendar.cs:36](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Project/Model/ProjectCalendar.cs#L36)

Date-bounded weekday overrides, applied after date exceptions and before the ordinary week.

## Inherited Properties

`public string? Name { get; set; }` [#](#property-name)

[ProjectObject.cs:53](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Project/Model/ProjectObject.cs#L53)

Inherited from [ProjectNamedEntity](/api/project/officeimo-project-projectnamedentity/)

`public int Uid { get; }` [#](#property-uid)

[ProjectObject.cs:42](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Project/Model/ProjectObject.cs#L42)

Inherited from [ProjectEntity](/api/project/officeimo-project-projectentity/)

`public Guid? Guid { get; set; }` [#](#property-guid)

[ProjectObject.cs:45](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Project/Model/ProjectObject.cs#L45)

Inherited from [ProjectEntity](/api/project/officeimo-project-projectentity/)

<!-- PowerForge markdown artifact sha256:FDF77540831017725A4F0B4AB7FEB0EEF07F391BD46C66E54A4D51984764B086 -->
