From 10157920a49149927c3a57769f1da6b578f95cf9 Mon Sep 17 00:00:00 2001 From: Marko Zunic Date: Mon, 11 Jan 2021 15:49:06 +0100 Subject: [PATCH] Minor bug fix: bar-start and bar-end property of pushed overlapping bar is set to a date-formatted string instead of a moment object --- package-lock.json | 2 +- package.json | 5 +++-- src/GGanttBar.vue | 4 ++-- src/GGanttChart.vue | 2 +- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index 6d5e3dd..16abc83 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "vue-ganttastic", - "version": "0.9.13", + "version": "0.9.16", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index c977ffe..09cae76 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vue-ganttastic", - "version": "0.9.15", + "version": "0.9.26", "description": "A simple and customizable Gantt chart component for Vue.js", "repository": { "type": "git", @@ -32,5 +32,6 @@ }, "peerDependencies": { "moment": "^2.26.0" - } + }, + "dependencies": {} } diff --git a/src/GGanttBar.vue b/src/GGanttBar.vue index 84551ca..fac037e 100644 --- a/src/GGanttBar.vue +++ b/src/GGanttBar.vue @@ -303,12 +303,12 @@ export default { case "left": minuteDiff = overlapEndMoment.diff(currentStartMoment, "minutes", true) overlapBar[this.barEnd] = currentBar[this.barStart] - overlapBar[this.barStart] = overlapStartMoment.subtract(minuteDiff, "minutes", true) + overlapBar[this.barStart] = overlapStartMoment.subtract(minuteDiff, "minutes", true).format("YYYY-MM-DD HH:mm:ss") break case "right": minuteDiff = currentEndMoment.diff(overlapStartMoment, "minutes", true) overlapBar[this.barStart] = currentBar[this.barEnd] - overlapBar[this.barEnd] = overlapEndMoment.add(minuteDiff, "minutes", true) + overlapBar[this.barEnd] = overlapEndMoment.add(minuteDiff, "minutes", true).format("YYYY-MM-DD HH:mm:ss") break default: console.warn("One bar is inside of the other one! This should never occur while push-on-overlap is active!") diff --git a/src/GGanttChart.vue b/src/GGanttChart.vue index 04317f7..735b764 100644 --- a/src/GGanttChart.vue +++ b/src/GGanttChart.vue @@ -224,7 +224,7 @@ export default { while(nextBar){ let currentBarOffsetRight = currentBar.$refs['g-gantt-bar'].offsetLeft + currentBar.$refs['g-gantt-bar'].offsetWidth gapDistanceSoFar += nextBar.$refs['g-gantt-bar'].offsetLeft - currentBarOffsetRight - if(nextBar.barConfig.immobile){ + if(nextBar.barConfig.immobile || (nextBar.barConfig.isShadow && !ignoreShadows)){ return [gapDistanceSoFar, bundleBarsAndGapDist] } else if(nextBar.barConfig.bundle){ bundleBarsAndGapDist.push({bar: nextBar, gapDistance: gapDistanceSoFar})