From d027002cb98966eb669f8ce72c34e5fccab5474c Mon Sep 17 00:00:00 2001 From: STEINNI Date: Tue, 1 Sep 2026 15:51:15 +0000 Subject: [PATCH] gantt: fixed minstart date max endDate to grid on all days --- bzGantt.js | 17 ++++++++++------- graflow_examples/test8.html | 2 +- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/bzGantt.js b/bzGantt.js index 396f72c..9f2379c 100644 --- a/bzGantt.js +++ b/bzGantt.js @@ -134,18 +134,21 @@ class BZgantt extends Buildoz { } buildFlow(){ - const firstDate = new Date(this.tasks[0].start) + let firstDate = new Date(this.tasks[0].start) + let lastDate = new Date(this.tasks[0].end) for(const task of this.tasks){ const startDate = new Date(task.start) + const endDate = new Date(task.end) if(startDate < firstDate) firstDate = startDate + if(endDate > lastDate) lastDate = endDate } const flow = { "nodes": [], "links": [] } let curY = 0 - let endIdx = 0 + const endIdx = this.getDayIndex(firstDate, lastDate) for(const task of this.tasks){ const startIdx = this.getDayIndex(firstDate, new Date(task.start)) - endIdx = this.getDayIndex(firstDate, new Date(task.end)) + const taskEndIdx = this.getDayIndex(firstDate, new Date(task.end)) flow.nodes.push({ "nodeType": "bar", "id": task.id, @@ -156,7 +159,7 @@ class BZgantt extends Buildoz { "markup": { "task": task.name, "color": task.color || '#CCC', - "width": (startIdx{