fix(gantt): only update today value when changing to the gantt chart view
This commit is contained in:
parent
b77c7c2f45
commit
078d8b39a9
|
@ -38,9 +38,8 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import {computed, ref, watch, toRefs} from 'vue'
|
import {computed, ref, watch, toRefs, onMounted} from 'vue'
|
||||||
import {useRouter} from 'vue-router'
|
import {useRouter} from 'vue-router'
|
||||||
import {useNow} from '@vueuse/core'
|
|
||||||
|
|
||||||
import {getHexColor} from '@/models/task'
|
import {getHexColor} from '@/models/task'
|
||||||
|
|
||||||
|
@ -157,9 +156,8 @@ function openTask(e: {
|
||||||
|
|
||||||
const weekDayFromDate = useWeekDayFromDate()
|
const weekDayFromDate = useWeekDayFromDate()
|
||||||
|
|
||||||
const today = useNow({
|
const today = ref(new Date())
|
||||||
interval: 6 * 60 * 60 * 1000, // Every 6 hours
|
onMounted(() => today.value = new Date())
|
||||||
})
|
|
||||||
const dateIsToday = computed(() => (date: Date) => {
|
const dateIsToday = computed(() => (date: Date) => {
|
||||||
return (
|
return (
|
||||||
date.getDate() === today.value.getDate() &&
|
date.getDate() === today.value.getDate() &&
|
||||||
|
|
Reference in New Issue
Block a user