Is it possible to display scales logically like D+0, D+1?


I’m new to dhtmlx gantt.

We would like to be able to use gantt chart for creating a plan as a template, such that it can be reused multiple times.

In this case the user won’t know the start date when they are creating it, just that certain tasks may start on D+1 09:00 (on day 2 of the plan). I guess the same may apply at Hour and (potentially) Minute level as well.

Is it possible to use logical/relative dates within the gantt?

I have managed to get a reasonable starter (see attached) by forcing task times and using, but I am not aware of a way to show the day scale without showing an explicit date.

gantt.config.scales = [
    {unit: "hour", step: 1, format: "%H" },
    {unit: "minute", step: 1, format: "%i" }

Hi @dhub,

Firstly, I should say that the gantt chart can’t exist without defined “start” and “end” dates and there is no way to change this behavior and al

Regarding using “relative” dates while creating tasks, you may implement custom lightbox controls which will use the “start date” of the gantt as “D”, and create tasks based on this variable, you can read about custom controls by the following links:

It may look like follows:

Regarding just visual part, you can changer the format of the date scale using the template function, and return content that you need, it may look like the following fragment:

gantt.config.scales = [
  { unit: "day", step: 1, format: function(date){
     return "D" + String( gantt.columnIndexByDate(date) + 1) ;

Here is a demo:

Helpful API:
Set the initial dates for the timescale:

1 Like

Hi @Siarhei.

That’s very helpful - I believe I can work with that.