WIP: fix: moving task changes duration #2695

Closed
dpschen wants to merge 1 commits from dpschen/frontend:feature/fix-moving-task-changes-duration into main
2 changed files with 14 additions and 9 deletions

View File

@ -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="filters.dateFrom"
:chart-end="filters.dateTo"
precision="day"
bar-start="startDate"
bar-end="endDate"
@ -47,7 +47,7 @@ import isToday from 'dayjs/plugin/isToday'
import {getHexColor} from '@/models/task'
import {colorIsDark} from '@/helpers/color/colorIsDark'
import {isoToKebabDate} from '@/helpers/time/isoToKebabDate'
// import {isoToKebabDate} from '@/helpers/time/isoToKebabDate'
import {parseKebabDate} from '@/helpers/time/parseKebabDate'
import type {ITask, ITaskPartialWithId} from '@/modelTypes/ITask'
@ -72,7 +72,7 @@ export interface GanttChartProps {
defaultTaskEndDate: DateISO
}
const DAYJS_ISO_DATE_FORMAT = 'YYYY-MM-DD'
const DAYJS_ISO_DATE_FORMAT = 'YYYY-MM-DDTHH:mm:ss.SSS[Z]'
const props = defineProps<GanttChartProps>()
@ -88,6 +88,13 @@ const dayjsLanguageLoading = ref(false)
dayjs.extend(isToday)
extendDayjs()
const testdate = new Date()
console.log(testdate)
console.log('reference date isostring', testdate.toISOString())
console.log('dayjs', dayjs(testdate).toDate().toISOString)
const router = useRouter()
const dateFromDate = computed(() => new Date(new Date(filters.value.dateFrom).setHours(0,0,0,0)))
@ -117,8 +124,8 @@ watch(
function transformTaskToGanttBar(t: ITask) {
const black = 'var(--grey-800)'
return [{
startDate: isoToKebabDate(t.startDate ? t.startDate.toISOString() : props.defaultTaskStartDate),
endDate: isoToKebabDate(t.endDate ? t.endDate.toISOString() : props.defaultTaskEndDate),
startDate: t.startDate ? t.startDate.toISOString() : props.defaultTaskStartDate,
endDate: t.endDate ? t.endDate.toISOString() : props.defaultTaskEndDate,
ganttBarConfig: {
id: String(t.id),
label: t.title,

View File

@ -2,6 +2,4 @@
* Returns a date as a string value in ISO format.
* same format as `new Date().toISOString()`
*/
export type DateISO<T extends string = string> = T
new Date().toISOString()
export type DateISO<T extends string = string> = T