Skip to content

[Update] Bar draw in minutes #421

@vipperxvr

Description

@vipperxvr

Bar draw starts and ends using only the hour as parameter.

I changed the code to use minutes.

image

At bar.js

  compute_x() {
    const { step, column_width } = this.gantt.options;
    const task_start = this.task._start;
    const gantt_start = this.gantt.gantt_start;

    const diff = date_utils.diff(task_start, gantt_start, "minutes");
    let x = (diff / 60 / step) * column_width;

    if (this.gantt.view_is("Month")) {
      const diff = date_utils.diff(task_start, gantt_start, "day");
      x = (diff * column_width) / 30;
    }
    this.x = Math.floor(x);
  }

  compute_duration() {
    this.duration =
      date_utils.diff(this.task._end, this.task._start, "minute") / 60 /
      this.gantt.options.step;
  }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions