feat: Update date-time parser in update:task event

This commit is contained in:
Wake Liu 2024-04-27 02:41:53 +08:00
parent fe104334a1
commit d8dcf65284
1 changed files with 3 additions and 2 deletions

View File

@ -52,6 +52,7 @@ import {colorIsDark} from '@/helpers/color/colorIsDark'
import {isoToKebabDate} from '@/helpers/time/isoToKebabDate'
import {isoToKebabDatetime} from '@/helpers/time/isoToKebabDatetime'
import {parseKebabDate} from '@/helpers/time/parseKebabDate'
import {parseKebabDatetime} from '@/helpers/time/parseKebabDatetime'
import type {ITask, ITaskPartialWithId} from '@/modelTypes/ITask'
import type {DateISO} from '@/types/DateISO'
@ -180,8 +181,8 @@ async function updateGanttTask(e: {
}) {
emit('update:task', {
id: Number(e.bar.ganttBarConfig.id),
startDate: new Date(parseKebabDate(e.bar.startDate).setHours(0,0,0,0)),
endDate: new Date(parseKebabDate(e.bar.endDate).setHours(23,59,0,0)),
startDate: new Date(parseKebabDatetime(e.bar.startDate)),
endDate: new Date(parseKebabDatetime(e.bar.endDate)),
})
}