1
0

chore(gantt): wip daterange

This commit is contained in:
Dominik Pschenitschni
2022-10-10 21:44:59 +02:00
committed by kolaente
parent 3b244dfdbe
commit 9f146c8c7f
17 changed files with 659 additions and 158 deletions

View File

@ -0,0 +1,21 @@
import { defineAsyncComponent, type AsyncComponentLoader, type AsyncComponentOptions, type Component, type ComponentPublicInstance } from 'vue'
import ErrorComponent from '@/components/misc/error.vue'
import LoadingComponent from '@/components/misc/loading.vue'
const DEFAULT_TIMEOUT = 60000
export function createAsyncComponent<T extends Component = {
new (): ComponentPublicInstance;
}>(source: AsyncComponentLoader<T> | AsyncComponentOptions<T>): T {
if (typeof source === 'function') {
source = { loader: source }
}
return defineAsyncComponent({
...source,
loadingComponent: LoadingComponent,
errorComponent: ErrorComponent,
timeout: DEFAULT_TIMEOUT,
})
}

View File

@ -1,5 +1,7 @@
import {createDateFromString} from '@/helpers/time/createDateFromString'
import {format, formatDistanceToNow, formatISO as formatISOfns} from 'date-fns'
// FIXME: support all locales and load dynamically
import {enGB, de, fr, ru} from 'date-fns/locale'
import {i18n} from '@/i18n'