2
0
mirror of https://github.com/tenrok/vue-ganttastic.git synced 2026-06-22 23:00:33 +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",
"version": "0.9.13",
"version": "0.9.16",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
+3 -2
View File
@@ -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": {}
}
+2 -2
View File
@@ -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!")
+1 -1
View File
@@ -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})