Skip to main content

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:
gantt.attachEvent("onLoadEnd", function() {
    gantt.showDate(new Date());
});
Option 2 — Scroll after each render cycle:
gantt.attachEvent("onDataRender", function() {
    gantt.showDate(new Date());
});
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.

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.
ParameterDefaultDescription
showTodayMarkertrueDisplay a vertical line on today’s date
nextedy.gantt.today.colorgrayColor 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
diagram
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 for details.

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:
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

KB ArticlesSupport TicketsSource Code
  • prod-gantt-src/com.nextedy.polarion.gantt.client/src/js/components/Menu.js
  • prod-gantt-src/com.nextedy.polarion.gantt.client/src/js/commands.js
  • prod-gantt-src/com.nextedy.polarion.gantt.client/cypress/e2e/milestones/marker-colors.cy.ts
  • prod-gantt-src/com.nextedy.polarion.gantt/src/com/nextedy/polarion/gantt/model/MarkerFactory.java
  • prod-gantt-src/com.nextedy.polarion.gantt/src/com/nextedy/polarion/gantt/widget/GanttWidgetConfig.java