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

# Scroll to Today on Load

> This guide shows you how to automatically scroll the Nextedy GANTT timeline to today's date when the chart loads, and how to configure the today marker.

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

## Use the Toolbar Button

The Gantt toolbar includes a **Go to today** button that scrolls the timeline to the current date with a single click. You can also access this action by right-clicking on the time scale header area and selecting the scroll-to-today option from the context menu.

## Scroll to Today Automatically on Load

To make the Gantt always center on today's date when the page loads, add a script to the Gantt Config Script:

1. Open the Polarion page containing the Gantt widget
2. Edit the widget properties
3. Navigate to **Advanced > Gantt Config Script**
4. Add one of the following scripts:

**Option 1 -- Scroll after all data loads:**

```javascript theme={null}
gantt.attachEvent("onLoadEnd", function() {
    gantt.showDate(new Date());
});
```

**Option 2 -- Scroll after each render cycle:**

```javascript theme={null}
gantt.attachEvent("onDataRender", function() {
    gantt.showDate(new Date());
});
```

<Tip title="Choose the right event">
  Use `onLoadEnd` if you want the scroll to happen once when data finishes loading. Use `onDataRender` if you want the view to re-center after every render (for example, after filtering or expanding/collapsing tasks). For most use cases, `onLoadEnd` is sufficient.
</Tip>

## Configure the Today Marker

The today marker is a vertical line on the Gantt timeline indicating the current date. You can show or hide it using the `showTodayMarker` widget parameter.

| Parameter                   | Default | Description                                         |
| --------------------------- | ------- | --------------------------------------------------- |
| `showTodayMarker`           | `true`  | Display a vertical line on today's date             |
| `nextedy.gantt.today.color` | `gray`  | Color of the today marker (administration property) |

To hide the today marker:

1. Edit the widget properties
2. Navigate to **Advanced > Show Today Marker**
3. Set it to **No**

<Frame>
  <img src="https://mintcdn.com/none-17b4493f/umKaPvHwUHw-ZQFM/gantt/diagrams/guides/layout/scroll-to-today/diagram-1.svg?fit=max&auto=format&n=umKaPvHwUHw-ZQFM&q=85&s=527858e55af3959df3b88706c99dda5c" alt="diagram" style={{ maxWidth: "600px", width: "100%" }} width="600" height="460" data-path="gantt/diagrams/guides/layout/scroll-to-today/diagram-1.svg" />
</Frame>

<Warning title="Today marker shows server time">
  The today marker position is determined by the **server's date and time**, not the user's local time. If your Polarion server is in a different timezone than your users, the today marker may appear to be a day off. This is expected behavior. See [Troubleshooting Today Marker Position](/gantt/guides/troubleshooting/today-marker-position) for details.
</Warning>

## Combine with Collapse on Load

A common configuration pattern combines scroll-to-today with starting the Gantt in a collapsed state. To start with all task groups collapsed, add the following to your **Item Script**:

```javascript theme={null}
task.open = false;
```

This collapses all parent tasks on load. Users can then expand groups as needed while the timeline is already centered on today's date.

## Verify Your Configuration

1. Reload the Polarion page containing the Gantt widget
2. You should now see the timeline automatically scrolled so that today's date is in the visible area
3. If `showTodayMarker` is enabled, a vertical line marks today's date on the timeline
4. Click the **Go to today** toolbar button to confirm it scrolls to the same position

## See Also

* [Troubleshooting Today Marker Position](/gantt/guides/troubleshooting/today-marker-position) for timezone-related marker issues
* [Configure the Time Scale](/gantt/guides/visualization/timescale) for adjusting the zoom level
* [Create and Configure Markers](/gantt/guides/visualization/markers) for adding custom date markers
* [Write Gantt Config Scripts](/gantt/guides/scripting/gantt-config-script) for more configuration script examples
* [Set the Gantt Time Range](/gantt/guides/scheduling/set-time-range) for controlling the overall visible date range

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