> ## Documentation Index
> Fetch the complete documentation index at: https://learn.nextedy.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Calendar and Working Hours Properties

> Nextedy GANTT uses working calendars to define resource availability, working hours, and schedule exceptions.

export const LastReviewed = ({date}) => {
  if (!date) return null;
  const formatted = new Date(`${date}T00:00:00Z`).toLocaleDateString("en-US", {
    year: "numeric",
    month: "long",
    day: "numeric",
    timeZone: "UTC"
  });
  return <p className="mt-10 text-sm text-gray-400 dark:text-zinc-500 not-prose">
      Last reviewed on {formatted}
    </p>;
};

Set these properties in **Administration > Configuration Properties**.

## Calendar Project Properties

| Name                                       | Type     | Default | Description                                                                                                                                                                                 |
| ------------------------------------------ | -------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `nextedy.gantt.workitemCalendar.projectId` | `String` | *empty* | Polarion project ID where work item calendars (per-user and global) are stored. Must be set on both the calendar project and any projects that reference it.                                |
| `nextedy.gantt.workitemCalendar.globalID`  | `String` | *empty* | Work item ID of a `calendar` type work item used as the global calendar. If you prefer not to create a dedicated calendar, you can use a placeholder empty calendar.                        |
| `nextedy.gantt.calendarHolder`             | `String` | *empty* | Polarion user ID whose calendar work item is used as the global working calendar. Use this when the global calendar is assigned to a specific user account rather than being project-level. |

<Warning title="Apply to Both Projects">
  The `nextedy.gantt.workitemCalendar.projectId` and `nextedy.gantt.workitemCalendar.globalID` properties must be configured on **both** the calendar project and any consuming projects.
</Warning>

## Working Hours Properties

| Name                               | Type      | Default | Description                                                                                                                                                                        |
| ---------------------------------- | --------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `nextedy.gantt.workingHoursPerDay` | `Integer` | `8`     | Default number of working hours per day for all resources. Set in **Administration > Configuration Properties** to apply globally, or override per widget via Gantt Config Script. |

### Custom Working Hours Function

For different working hours per resource, define a custom function in the Gantt Config Script widget parameter:

```javascript theme={null}
gantt.config.workingHoursPerDayFunction = (resource) => {
  if (resource === "rProject") {
    return 4;
  }
  return 8;
};
```

<Tip title="Velocity-Powered Functions">
  The Gantt Config Script supports Velocity expressions. You can use `$trackerService` to dynamically build the working hours function based on work item data. The function definition is produced by Velocity on the server, then executed on the client.
</Tip>

## Calendar Work Item Types

The working calendar system uses four dedicated work item types:

| Work Item Type | ID              | Purpose                                                                                                                            |
| -------------- | --------------- | ---------------------------------------------------------------------------------------------------------------------------------- |
| Calendar       | `calendar`      | Defines regular working hours per weekday and the validity date range. All exceptions and inheritance chains connect to this type. |
| Time Off       | `timeoff`       | Marks specific date ranges as non-working days in a linked calendar. Used for holidays and vacations.                              |
| Time On        | `timeon`        | Activates additional working days, overriding Time Off exceptions. Used when a specific user must work during a global holiday.    |
| Tweak          | `scheduletweak` | Adjusts working hours for a date range without changing working/non-working status. Used for half-days or reduced schedules.       |

## Calendar Custom Fields

Each `calendar` work item uses the following custom fields to define the weekly schedule:

| Field              | Type     | Format        | Description                                                                                                |
| ------------------ | -------- | ------------- | ---------------------------------------------------------------------------------------------------------- |
| `from`             | Date     | `YYYY-MM-DD`  | Date when the calendar becomes active. If empty, no start boundary.                                        |
| `to`               | Date     | `YYYY-MM-DD`  | Date when the calendar expires. If empty, no end boundary.                                                 |
| `regularMonday`    | `String` | `HH:mm,HH:mm` | Working hours for Monday. Use `-` for explicitly non-working. Leave empty to inherit from parent calendar. |
| `regularTuesday`   | `String` | `HH:mm,HH:mm` | Working hours for Tuesday. Same format as Monday.                                                          |
| `regularWednesday` | `String` | `HH:mm,HH:mm` | Working hours for Wednesday. Same format as Monday.                                                        |
| `regularThursday`  | `String` | `HH:mm,HH:mm` | Working hours for Thursday. Same format as Monday.                                                         |
| `regularFriday`    | `String` | `HH:mm,HH:mm` | Working hours for Friday. Same format as Monday.                                                           |
| `regularSaturday`  | `String` | `HH:mm,HH:mm` | Working hours for Saturday. Typically `-` for standard work week.                                          |
| `regularSunday`    | `String` | `HH:mm,HH:mm` | Working hours for Sunday. Typically `-` for standard work week.                                            |

<Note title="Weekday Hour Format">
  Use the format `HH:mm,HH:mm` (e.g., `09:00,17:00` for a standard 8-hour day). Use `-` to mark a day as explicitly non-working. Leave the field empty to inherit hours from the parent calendar.
</Note>

## Calendar Inheritance

Calendars support inheritance via the `inherits from` work item link role:

* A child calendar inherits base hours from its parent calendar
* Weekday fields left empty in the child calendar use the parent's hours
* Weekday fields set explicitly in the child override the parent's hours
* The `-` value means explicitly non-working (does not inherit)

### Resolution Order

When the Gantt chart calculates effective working hours for a specific date, it applies the following resolution order:

<Frame>
  <img src="https://mintcdn.com/none-17b4493f/umKaPvHwUHw-ZQFM/gantt/diagrams/reference/configuration/calendar-properties/diagram-1.svg?fit=max&auto=format&n=umKaPvHwUHw-ZQFM&q=85&s=d773a8aff7b1817830f5fc1219f722b6" alt="diagram" style={{ maxWidth: "340px", width: "100%" }} width="340" height="380" data-path="gantt/diagrams/reference/configuration/calendar-properties/diagram-1.svg" />
</Frame>

## Calendar Modes in Resource View

The resource view supports three calendar resolution modes that affect capacity calculation:

| Mode                 | Description                                                                                                                                                    |
| -------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Global Calendar**  | Default mode. Uses the project-wide working calendar for all resources. Off-days apply to all task and resource rows equally.                                  |
| **User Calendars**   | When **Load User Calendars** is enabled, per-user working calendars are applied per resource row. Each user's off-days are based on their individual calendar. |
| **Team Assignments** | When **Load Team Assignments** is enabled, cells where a resource has zero team assignment hours are marked as unavailable.                                    |

<Tip title="Base Calendar Overlay">
  A designated user can act as a base calendar holder (via `nextedy.gantt.calendarHolder`). Their off-days are applied as the baseline, and other users' calendars overlay additional off-days on top.
</Tip>

## Configuration Example

To connect a project to a central working calendar project:

```properties theme={null}
nextedy.gantt.workitemCalendar.projectId=WICalendars
nextedy.gantt.workitemCalendar.globalID=WI-001
```

To set a global calendar via a placeholder user:

```properties theme={null}
nextedy.gantt.calendarHolder=calendarUser
```

To change the default working hours globally:

```properties theme={null}
nextedy.gantt.workingHoursPerDay=7
```

## Related Pages

* [Working Calendars Parameters](/gantt/reference/widget-parameters/working-calendars) -- widget-level calendar settings
* [Team and Resource Properties](/gantt/reference/configuration/team-properties) -- team capacity and resource configuration
* [Resource View Parameters](/gantt/reference/widget-parameters/resource-view) -- resource load modes and display options
* [Item Script API](/gantt/reference/api/item-script-api) -- access calendar data in scripts

<LastReviewed date="2026-07-02" />
