mirror of
https://github.com/tenrok/vue-ganttastic.git
synced 2026-06-19 09:40:32 +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) {
|
||||
let timeDiffFromStart =
|
||||
(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