mirror of https://kolaente.dev/vikunja/api.git
feat: Update date and time format handling
1. Changed the `DAYJS_ISO_DATE_FORMAT` constant to 'YYYY-MM-DD HH:mm'. 2. Updated the Gantt chart component's date-time parameters to `isoToKebabDatetime`. 3. Modified the date formatting in task data to `isoToKebabDatetime`.
This commit is contained in:
parent
d183fafa1e
commit
2833f97c16
|
@ -10,8 +10,8 @@
|
|||
>
|
||||
<GGanttChart
|
||||
:date-format="DAYJS_ISO_DATE_FORMAT"
|
||||
:chart-start="isoToKebabDate(filters.dateFrom)"
|
||||
:chart-end="isoToKebabDate(filters.dateTo)"
|
||||
:chart-start="isoToKebabDatetime(dateFromDate.toISOString())"
|
||||
:chart-end="isoToKebabDatetime(dateToDate.toISOString())"
|
||||
precision="day"
|
||||
bar-start="startDate"
|
||||
bar-end="endDate"
|
||||
|
@ -50,6 +50,7 @@ import {getHexColor} from '@/models/task'
|
|||
|
||||
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 type {ITask, ITaskPartialWithId} from '@/modelTypes/ITask'
|
||||
|
@ -83,7 +84,7 @@ const emit = defineEmits<{
|
|||
(e: 'update:task', task: ITaskPartialWithId): void
|
||||
}>()
|
||||
|
||||
const DAYJS_ISO_DATE_FORMAT = 'YYYY-MM-DD'
|
||||
const DAYJS_ISO_DATE_FORMAT = 'YYYY-MM-DD HH:mm'
|
||||
|
||||
const {tasks, filters} = toRefs(props)
|
||||
|
||||
|
@ -156,8 +157,8 @@ function transformTaskToGanttBar(t: ITask) {
|
|||
}
|
||||
|
||||
return [{
|
||||
startDate: isoToKebabDate(t.startDate ? t.startDate.toISOString() : props.defaultTaskStartDate),
|
||||
endDate: isoToKebabDate(t.endDate ? t.endDate.toISOString() : props.defaultTaskEndDate),
|
||||
startDate: isoToKebabDatetime(t.startDate ? t.startDate.toISOString() : props.defaultTaskStartDate),
|
||||
endDate: isoToKebabDatetime(t.endDate ? t.endDate.toISOString() : props.defaultTaskEndDate),
|
||||
ganttBarConfig: {
|
||||
id: String(t.id),
|
||||
label: t.title,
|
||||
|
|
Loading…
Reference in New Issue