mirror of
https://github.com/tenrok/vue-ganttastic.git
synced 2026-06-24 02:40:33 +03:00
fix: timeaxis display bugs
This commit is contained in:
@@ -19,7 +19,7 @@
|
|||||||
color: themeColors.text,
|
color: themeColors.text,
|
||||||
}"
|
}"
|
||||||
>
|
>
|
||||||
<div>{{ pointFormatted(point) }}</div>
|
<div v-html="pointFormatted(point)||' '"></div>
|
||||||
<div
|
<div
|
||||||
:style="{ background: themeColors.ternary, color: themeColors.text }"
|
:style="{ background: themeColors.ternary, color: themeColors.text }"
|
||||||
>
|
>
|
||||||
@@ -103,11 +103,11 @@ export default {
|
|||||||
this.childPointCount = Math.floor(end.diff(start, 'day', true))
|
this.childPointCount = Math.floor(end.diff(start, 'day', true))
|
||||||
while (start.isBefore(end)) {
|
while (start.isBefore(end)) {
|
||||||
let dayCountOfMonth = start.isSame(end, 'month')
|
let dayCountOfMonth = start.isSame(end, 'month')
|
||||||
? end.date()
|
? end.date() - 1
|
||||||
: start.daysInMonth() - start.date() + 1
|
: start.daysInMonth() - start.date() + 1
|
||||||
let widthPercentage = (dayCountOfMonth / this.childPointCount) * 100
|
let widthPercentage = (dayCountOfMonth / this.childPointCount) * 100
|
||||||
let endDay =
|
let endDay =
|
||||||
start.month() === end.month() ? end.date() : start.daysInMonth()
|
start.month() === end.month() ? end.date() - 1 : start.daysInMonth()
|
||||||
this.axisPoints.push(
|
this.axisPoints.push(
|
||||||
this.getAxisMonthObject(start, widthPercentage, endDay)
|
this.getAxisMonthObject(start, widthPercentage, endDay)
|
||||||
)
|
)
|
||||||
@@ -137,6 +137,7 @@ export default {
|
|||||||
let datetimeMoment = moment(datetime)
|
let datetimeMoment = moment(datetime)
|
||||||
let axisMonthObject = {
|
let axisMonthObject = {
|
||||||
widthPercentage: widthPercentage,
|
widthPercentage: widthPercentage,
|
||||||
|
value: moment(datetime, 'YYYY-MM'),
|
||||||
childPoints: [],
|
childPoints: [],
|
||||||
}
|
}
|
||||||
let startDay = datetimeMoment.date()
|
let startDay = datetimeMoment.date()
|
||||||
|
|||||||
Reference in New Issue
Block a user