forked from vikunja/frontend
Initial work
This commit is contained in:
parent
66c7a05cdb
commit
95ac007d66
|
@ -6,8 +6,8 @@
|
|||
<div class="gantt-container" v-else>
|
||||
<GGanttChart
|
||||
:date-format="DAYJS_ISO_DATE_FORMAT"
|
||||
:chart-start="isoToKebabDate(filters.dateFrom)"
|
||||
:chart-end="isoToKebabDate(filters.dateTo)"
|
||||
:chart-start="isoToKebabDate(dateFromDate.toISOString())"
|
||||
:chart-end="isoToKebabDate(dateToDate.toISOString())"
|
||||
precision="day"
|
||||
bar-start="startDate"
|
||||
bar-end="endDate"
|
||||
|
@ -87,7 +87,31 @@ extendDayjs()
|
|||
|
||||
const router = useRouter()
|
||||
|
||||
const dateFromDate = computed(() => new Date(new Date(filters.value.dateFrom).setHours(0,0,0,0)))
|
||||
const dateFromDate = computed(() => {
|
||||
|
||||
if(filters.value.trimGanttDates) {
|
||||
|
||||
let firstTask = new Date();
|
||||
|
||||
tasks.value.forEach(task => {
|
||||
console.log(task.id + " - " + task.startDate)
|
||||
|
||||
let taskDate = task.startDate ?? (new Date())
|
||||
|
||||
firstTask = firstTask > taskDate ? taskDate : firstTask
|
||||
|
||||
console.log(task.id + " - " + taskDate)
|
||||
|
||||
});
|
||||
|
||||
console.log(firstTask)
|
||||
|
||||
return firstTask
|
||||
|
||||
} else {
|
||||
return new Date(new Date(filters.value.dateFrom).setHours(0,0,0,0))
|
||||
}
|
||||
})
|
||||
const dateToDate = computed(() => new Date(new Date(filters.value.dateTo).setHours(23,59,0,0)))
|
||||
|
||||
const DAY_WIDTH_PIXELS = 30
|
||||
|
|
|
@ -22,6 +22,9 @@
|
|||
<x-button @click="setDefaultFilters">Reset</x-button>
|
||||
</div>
|
||||
</div>
|
||||
<fancycheckbox is-block v-model="filters.trimGanttDates">
|
||||
{{ $t('project.gantt.trimGanttDates') }}
|
||||
</fancycheckbox>
|
||||
<fancycheckbox is-block v-model="filters.showTasksWithoutDates">
|
||||
{{ $t('project.gantt.showTasksWithoutDates') }}
|
||||
</fancycheckbox>
|
||||
|
|
|
@ -19,6 +19,7 @@ export interface GanttFilters {
|
|||
dateFrom: DateISO
|
||||
dateTo: DateISO
|
||||
showTasksWithoutDates: boolean
|
||||
trimGanttDates: boolean
|
||||
}
|
||||
|
||||
const DEFAULT_SHOW_TASKS_WITHOUT_DATES = false
|
||||
|
|
Loading…
Reference in New Issue