mirror of
https://github.com/tenrok/vue-ganttastic.git
synced 2026-06-22 11:40:34 +03:00
fix: pos calc error on month_day mode
This commit is contained in:
+5
-1
@@ -469,7 +469,11 @@ export default {
|
|||||||
mapPositionToTime(xPos) {
|
mapPositionToTime(xPos) {
|
||||||
let timeDiffFromStart =
|
let timeDiffFromStart =
|
||||||
(xPos / this.barContainer.width) * this.getTimeCount()
|
(xPos / this.barContainer.width) * this.getTimeCount()
|
||||||
return this.chartStartMoment.clone().add(timeDiffFromStart, this.timeUnit)
|
if (this.timeUnit === 'days') {
|
||||||
|
let duration = moment.duration(timeDiffFromStart, 'days')
|
||||||
|
timeDiffFromStart = duration.asHours()
|
||||||
|
}
|
||||||
|
return moment(this.chartStartMoment).add(timeDiffFromStart, 'hours')
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user