fix: don't try to dynamically load dayjs locales
This commit is contained in:
parent
6c619072b4
commit
b8e7b87f96
@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<Loading
|
<Loading
|
||||||
v-if="props.isLoading || dayjsLanguageLoading"
|
v-if="props.isLoading"
|
||||||
class="gantt-container"
|
class="gantt-container"
|
||||||
/>
|
/>
|
||||||
<div class="gantt-container" v-else>
|
<div class="gantt-container" v-else>
|
||||||
@ -46,7 +46,6 @@ import {format, parse} from 'date-fns'
|
|||||||
import dayjs from 'dayjs'
|
import dayjs from 'dayjs'
|
||||||
import isToday from 'dayjs/plugin/isToday'
|
import isToday from 'dayjs/plugin/isToday'
|
||||||
|
|
||||||
import {useDayjsLanguageSync} from '@/i18n'
|
|
||||||
import {getHexColor} from '@/models/task'
|
import {getHexColor} from '@/models/task'
|
||||||
|
|
||||||
import {colorIsDark} from '@/helpers/color/colorIsDark'
|
import {colorIsDark} from '@/helpers/color/colorIsDark'
|
||||||
@ -85,7 +84,6 @@ const emit = defineEmits<{
|
|||||||
const {tasks, filters} = toRefs(props)
|
const {tasks, filters} = toRefs(props)
|
||||||
|
|
||||||
// setup dayjs for vue-ganttastic
|
// setup dayjs for vue-ganttastic
|
||||||
const dayjsLanguageLoading = useDayjsLanguageSync(dayjs)
|
|
||||||
dayjs.extend(isToday)
|
dayjs.extend(isToday)
|
||||||
extendDayjs()
|
extendDayjs()
|
||||||
|
|
||||||
|
@ -91,6 +91,9 @@ export function setLanguage() {
|
|||||||
|
|
||||||
import type dayjs from 'dayjs'
|
import type dayjs from 'dayjs'
|
||||||
|
|
||||||
|
// FIXME: This function is not used at the moment because it does not seem to work.
|
||||||
|
// It should be reworked and cleaned up. An even better way would be to get rid of
|
||||||
|
// this completely by using date-fns for everything.
|
||||||
export function useDayjsLanguageSync(dayjsGlobal: typeof dayjs) {
|
export function useDayjsLanguageSync(dayjsGlobal: typeof dayjs) {
|
||||||
const dayjsLanguageLoaded = ref(false)
|
const dayjsLanguageLoaded = ref(false)
|
||||||
watch(
|
watch(
|
||||||
|
BIN
vendor/infectoone-vue-ganttastic-2.1.1.tgz
vendored
BIN
vendor/infectoone-vue-ganttastic-2.1.1.tgz
vendored
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user