2
0
mirror of https://github.com/tenrok/vue-ganttastic.git synced 2026-06-25 12:20:32 +03:00

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

This commit is contained in:
Marko Zunic
2021-01-11 15:49:06 +01:00
parent 4cfec09f88
commit 10157920a4
4 changed files with 7 additions and 6 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "vue-ganttastic", "name": "vue-ganttastic",
"version": "0.9.13", "version": "0.9.16",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {
+3 -2
View File
@@ -1,6 +1,6 @@
{ {
"name": "vue-ganttastic", "name": "vue-ganttastic",
"version": "0.9.15", "version": "0.9.26",
"description": "A simple and customizable Gantt chart component for Vue.js", "description": "A simple and customizable Gantt chart component for Vue.js",
"repository": { "repository": {
"type": "git", "type": "git",
@@ -32,5 +32,6 @@
}, },
"peerDependencies": { "peerDependencies": {
"moment": "^2.26.0" "moment": "^2.26.0"
} },
"dependencies": {}
} }
+2 -2
View File
@@ -303,12 +303,12 @@ export default {
case "left": case "left":
minuteDiff = overlapEndMoment.diff(currentStartMoment, "minutes", true) minuteDiff = overlapEndMoment.diff(currentStartMoment, "minutes", true)
overlapBar[this.barEnd] = currentBar[this.barStart] 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 break
case "right": case "right":
minuteDiff = currentEndMoment.diff(overlapStartMoment, "minutes", true) minuteDiff = currentEndMoment.diff(overlapStartMoment, "minutes", true)
overlapBar[this.barStart] = currentBar[this.barEnd] 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 break
default: default:
console.warn("One bar is inside of the other one! This should never occur while push-on-overlap is active!") console.warn("One bar is inside of the other one! This should never occur while push-on-overlap is active!")
+1 -1
View File
@@ -224,7 +224,7 @@ export default {
while(nextBar){ while(nextBar){
let currentBarOffsetRight = currentBar.$refs['g-gantt-bar'].offsetLeft + currentBar.$refs['g-gantt-bar'].offsetWidth let currentBarOffsetRight = currentBar.$refs['g-gantt-bar'].offsetLeft + currentBar.$refs['g-gantt-bar'].offsetWidth
gapDistanceSoFar += nextBar.$refs['g-gantt-bar'].offsetLeft - currentBarOffsetRight gapDistanceSoFar += nextBar.$refs['g-gantt-bar'].offsetLeft - currentBarOffsetRight
if(nextBar.barConfig.immobile){ if(nextBar.barConfig.immobile || (nextBar.barConfig.isShadow && !ignoreShadows)){
return [gapDistanceSoFar, bundleBarsAndGapDist] return [gapDistanceSoFar, bundleBarsAndGapDist]
} else if(nextBar.barConfig.bundle){ } else if(nextBar.barConfig.bundle){
bundleBarsAndGapDist.push({bar: nextBar, gapDistance: gapDistanceSoFar}) bundleBarsAndGapDist.push({bar: nextBar, gapDistance: gapDistanceSoFar})