> ## 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.

# Deadlines Parameters

> Nextedy GANTT can display deadline markers on the Gantt chart to differentiate between a task's planned end date and its hard deadline (due date).

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>;
};

## Deadlines Widget Parameters

| Name                    | Type    | Default         | Description                                                                                                                                                                                            |
| ----------------------- | ------- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `Show Deadlines`        | Boolean | `false`         | Master toggle that enables deadline marker display on the Gantt chart. All parameters below require this to be `true`.                                                                                 |
| `Deadline Field`        | String  | Empty           | The Polarion work item field name that holds the deadline date. Must be a Date-Only or String type field. Only visible when `Show Deadlines` is `true`.                                                |
| `Passed Deadline Color` | String  | See application | The CSS color applied to task bars where the end date extends past the deadline date. Accepts named colors (e.g., `red`) or hex codes (e.g., `#e53935`). Only visible when `Show Deadlines` is `true`. |

<Warning title="Parameter Dependency">
  The `Deadline Field` and `Passed Deadline Color` parameters only appear in the widget parameter editor after you set **Show Deadlines** to `Yes`.
</Warning>

## How Deadline Coloring Works

The deadline coloring logic compares the task's **end date** against the **deadline field value**:

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

<Note title="End Date Comparison, Not Current Date">
  The passed deadline color indicates a **schedule violation** -- the task's planned end date extends beyond its due date. It does **not** compare the deadline against today's date. To implement date-relative deadline coloring based on the current date, use a custom [Item Script](/gantt/reference/api/item-script-api).
</Note>

## Deadline Column

When deadlines are enabled, you can add a dedicated deadline column to the Gantt grid using the [Column Configuration Parameters](/gantt/reference/widget-parameters/columns). The deadline column:

* Displays the deadline date in a compact format (e.g., `Sep-09`, `Nov-30`).
* Shows the date in **red text** when the task is overdue (end date past deadline).
* Uses the `deadline` template ID in the column configuration.

## Supported Field Types

The `Deadline Field` parameter accepts the following Polarion custom field types:

| Field Type | Notes                                                                    |
| ---------- | ------------------------------------------------------------------------ |
| Date-Only  | Recommended. Stores a calendar date without time component.              |
| String     | Stores the date as a string value. For production use, prefer Date-Only. |

For a full list of supported field types, see [Supported Field Types](/gantt/reference/supported-field-types).

## Configuration Example

To enable deadline tracking using a custom field called `dueDate`:

1. Open **Widget Properties** for the Gantt widget.
2. In the **Deadlines** section:
   * Set **Show Deadlines** to `Yes`.
   * Set **Deadline Field** to `dueDate`.
   * Set **Passed Deadline Color** to `#e53935` (red).
3. Save the widget parameters.

Tasks with a `dueDate` value now display a deadline marker on the chart. If a task's end date extends past the `dueDate`, the task bar turns red.

## Dynamic Deadline Coloring via Item Script

For more advanced deadline logic (e.g., coloring based on proximity to the deadline or current date comparison), use the [Item Script API](/gantt/reference/api/item-script-api):

```javascript theme={null}
// Color task yellow if within 7 days of deadline, red if past
var deadline = util.getDate(wi, "dueDate");
var today = new java.util.Date();
if (deadline != null) {
    var daysLeft = (deadline.getTime() - today.getTime()) / (1000 * 60 * 60 * 24);
    if (daysLeft < 0) {
        task.color = "#e53935"; // Past deadline
    } else if (daysLeft < 7) {
        task.color = "#fb8c00"; // Approaching deadline
    }
}
```

<Info title="Verify in application">
  The Item Script approach provides more control than the built-in `Passed Deadline Color` parameter. Verify the exact `util.getDate()` API in your Gantt version.
</Info>

## Related Pages

* [Column Configuration Parameters](/gantt/reference/widget-parameters/columns) -- adding a deadline column to the grid
* [Item Script API](/gantt/reference/api/item-script-api) -- custom deadline coloring logic
* [Color and Styling Properties](/gantt/reference/configuration/color-properties) -- global color configuration
* [Data Mapping Parameters](/gantt/reference/widget-parameters/data-mapping) -- mapping work item fields for scheduling

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