mirror of
https://github.com/tenrok/vue-ganttastic.git
synced 2026-06-23 20:10:33 +03:00
fix: time axis gone on day_hours mode
This commit is contained in:
@@ -24,7 +24,7 @@
|
|||||||
:style="{ background: themeColors.ternary, color: themeColors.text }"
|
:style="{ background: themeColors.ternary, color: themeColors.text }"
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
v-for="(childPoint, index) in point.ganttDays"
|
v-for="(childPoint, index) in point.childPoints"
|
||||||
:key="childPoint.fullDatetime"
|
:key="childPoint.fullDatetime"
|
||||||
class="g-timeaxis-hour"
|
class="g-timeaxis-hour"
|
||||||
:style="{
|
:style="{
|
||||||
@@ -137,8 +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'), // ISO 8601
|
childPoints: [],
|
||||||
ganttDays: [],
|
|
||||||
}
|
}
|
||||||
let startDay = datetimeMoment.date()
|
let startDay = datetimeMoment.date()
|
||||||
for (let i = 0; i <= endDay - startDay; i++) {
|
for (let i = 0; i <= endDay - startDay; i++) {
|
||||||
@@ -146,7 +145,7 @@ export default {
|
|||||||
text: datetimeMoment.format('D'),
|
text: datetimeMoment.format('D'),
|
||||||
fullDatetime: datetimeMoment.format(this.timeFormat),
|
fullDatetime: datetimeMoment.format(this.timeFormat),
|
||||||
}
|
}
|
||||||
axisMonthObject.ganttDays.push(day)
|
axisMonthObject.childPoints.push(day)
|
||||||
datetimeMoment.add(1, 'day')
|
datetimeMoment.add(1, 'day')
|
||||||
}
|
}
|
||||||
return axisMonthObject
|
return axisMonthObject
|
||||||
@@ -157,7 +156,7 @@ export default {
|
|||||||
let axisDayObject = {
|
let axisDayObject = {
|
||||||
widthPercentage: widthPercentage,
|
widthPercentage: widthPercentage,
|
||||||
value: moment(datetime, 'YYYY-MM-DD'), // ISO 8601
|
value: moment(datetime, 'YYYY-MM-DD'), // ISO 8601
|
||||||
ganttHours: [],
|
childPoints: [],
|
||||||
}
|
}
|
||||||
let startHour = datetimeMoment.hour()
|
let startHour = datetimeMoment.hour()
|
||||||
for (let i = 0; i <= endHour - startHour; i++) {
|
for (let i = 0; i <= endHour - startHour; i++) {
|
||||||
@@ -165,7 +164,7 @@ export default {
|
|||||||
text: datetimeMoment.format('HH'),
|
text: datetimeMoment.format('HH'),
|
||||||
fullDatetime: datetimeMoment.format(this.timeFormat),
|
fullDatetime: datetimeMoment.format(this.timeFormat),
|
||||||
}
|
}
|
||||||
axisDayObject.ganttHours.push(hour)
|
axisDayObject.childPoints.push(hour)
|
||||||
datetimeMoment.add(1, 'hour')
|
datetimeMoment.add(1, 'hour')
|
||||||
}
|
}
|
||||||
return axisDayObject
|
return axisDayObject
|
||||||
|
|||||||
Reference in New Issue
Block a user