From c9fc5a97b819d9c64c9d64f23eb7816e9db143bf Mon Sep 17 00:00:00 2001 From: yicone Date: Tue, 9 Feb 2021 22:33:18 +0800 Subject: [PATCH] fix: timeaxis display bugs --- src/GGanttTimeaxis.vue | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/GGanttTimeaxis.vue b/src/GGanttTimeaxis.vue index 03c52b3..7a1213e 100644 --- a/src/GGanttTimeaxis.vue +++ b/src/GGanttTimeaxis.vue @@ -19,7 +19,7 @@ color: themeColors.text, }" > -
{{ pointFormatted(point) }}
+
@@ -103,11 +103,11 @@ export default { this.childPointCount = Math.floor(end.diff(start, 'day', true)) while (start.isBefore(end)) { let dayCountOfMonth = start.isSame(end, 'month') - ? end.date() + ? end.date() - 1 : start.daysInMonth() - start.date() + 1 let widthPercentage = (dayCountOfMonth / this.childPointCount) * 100 let endDay = - start.month() === end.month() ? end.date() : start.daysInMonth() + start.month() === end.month() ? end.date() - 1 : start.daysInMonth() this.axisPoints.push( this.getAxisMonthObject(start, widthPercentage, endDay) ) @@ -137,6 +137,7 @@ export default { let datetimeMoment = moment(datetime) let axisMonthObject = { widthPercentage: widthPercentage, + value: moment(datetime, 'YYYY-MM'), childPoints: [], } let startDay = datetimeMoment.date()