From 388a31d95a74f5a4f4f1cc3c924f03a82f24b69c Mon Sep 17 00:00:00 2001 From: kolaente Date: Sat, 4 Sep 2021 21:56:22 +0200 Subject: [PATCH] Fix gantt months being wrong --- src/components/tasks/gantt-component.vue | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/src/components/tasks/gantt-component.vue b/src/components/tasks/gantt-component.vue index 2ed3a0b7..aa55affe 100644 --- a/src/components/tasks/gantt-component.vue +++ b/src/components/tasks/gantt-component.vue @@ -25,17 +25,12 @@ v-for="(m, mk) in days[yk]" > {{ - new Date( - new Date(yk).setMonth(mk) - ).toLocaleString('en-us', {month: 'long'}) + new Date(new Date(`${yk}-${parseInt(mk) + 1}-01`)).toLocaleString('en-us', {month: 'long'}) }}, {{ new Date(yk).getFullYear() }}
[months => [days]] @@ -306,14 +299,14 @@ export default { years[date.getFullYear() + ''] = {} } if ( - years[date.getFullYear() + ''][date.getMonth() + ''] === - undefined + years[date.getFullYear() + ''][date.getMonth() + ''] === undefined ) { years[date.getFullYear() + ''][date.getMonth() + ''] = [] } years[date.getFullYear() + ''][date.getMonth() + ''].push(date) this.fullWidth += this.dayWidth } + console.log(years) this.$set(this, 'days', years) }, parseTasks() {