fix: check now just once
This commit is contained in:
parent
e54d95802b
commit
6d62ca1ada
2 changed files with 20 additions and 13 deletions
|
@ -68,21 +68,26 @@
|
||||||
import { ref, computed } from 'vue'
|
import { ref, computed } from 'vue'
|
||||||
import flatPickr from 'vue-flatpickr-component'
|
import flatPickr from 'vue-flatpickr-component'
|
||||||
|
|
||||||
import { i18n } from '@/i18n'
|
import { useI18n } from 'vue-i18n'
|
||||||
import { store } from '@/store'
|
import { useStore } from 'vuex'
|
||||||
|
|
||||||
import ListWrapper from './ListWrapper'
|
import ListWrapper from './ListWrapper'
|
||||||
import GanttChart from '@/components/tasks/gantt-component'
|
import GanttChart from '@/components/tasks/gantt-component'
|
||||||
import Fancycheckbox from '@/components/input/fancycheckbox'
|
import Fancycheckbox from '@/components/input/fancycheckbox'
|
||||||
|
|
||||||
|
const DEFAULT_DAY_COUNT = 35
|
||||||
|
|
||||||
const showTaskswithoutDates = ref(false)
|
const showTaskswithoutDates = ref(false)
|
||||||
const dayWidth = ref(35)
|
const dayWidth = ref(DEFAULT_DAY_COUNT)
|
||||||
const dateFrom = ref(new Date((new Date()).setDate((new Date()).getDate() - 15)))
|
|
||||||
const dateTo = ref(new Date((new Date()).setDate((new Date()).getDate() + 30)))
|
|
||||||
|
|
||||||
|
const now = ref(new Date())
|
||||||
|
const dateFrom = ref(new Date((new Date()).setDate(now.value.getDate() - 15)))
|
||||||
|
const dateTo = ref(new Date((new Date()).setDate(now.value.getDate() + 30)))
|
||||||
|
|
||||||
|
const {t} = useI18n()
|
||||||
|
const {store} = useStore()
|
||||||
const flatPickerConfig = computed(() => ({
|
const flatPickerConfig = computed(() => ({
|
||||||
altFormat: i18n.global.t('date.altFormatShort'),
|
altFormat: t('date.altFormatShort'),
|
||||||
altInput: true,
|
altInput: true,
|
||||||
dateFormat: 'Y-m-d',
|
dateFormat: 'Y-m-d',
|
||||||
enableTime: false,
|
enableTime: false,
|
||||||
|
|
|
@ -231,23 +231,25 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
setDatesToNextWeek() {
|
setDatesToNextWeek() {
|
||||||
this.cStartDate = new Date()
|
const now = new Date()
|
||||||
this.cEndDate = new Date((new Date()).getTime() + 7 * 24 * 60 * 60 * 1000)
|
this.cStartDate = now
|
||||||
|
this.cEndDate = new Date(now.getTime() + 7 * 24 * 60 * 60 * 1000)
|
||||||
this.showOverdue = false
|
this.showOverdue = false
|
||||||
this.setDate()
|
this.setDate()
|
||||||
},
|
},
|
||||||
|
|
||||||
setDatesToNextMonth() {
|
setDatesToNextMonth() {
|
||||||
this.cStartDate = new Date()
|
const now = new Date()
|
||||||
this.cEndDate = new Date((new Date()).setMonth((new Date()).getMonth() + 1))
|
this.cStartDate = now
|
||||||
|
this.cEndDate = new Date((new Date()).setMonth(now.getMonth() + 1))
|
||||||
this.showOverdue = false
|
this.showOverdue = false
|
||||||
this.setDate()
|
this.setDate()
|
||||||
},
|
},
|
||||||
|
|
||||||
showTodaysTasks() {
|
showTodaysTasks() {
|
||||||
const d = new Date()
|
const now = new Date()
|
||||||
this.cStartDate = new Date()
|
this.cStartDate = now
|
||||||
this.cEndDate = new Date(d.setDate(d.getDate() + 1))
|
this.cEndDate = new Date((new Date()).setDate(now.getDate() + 1))
|
||||||
this.showOverdue = true
|
this.showOverdue = true
|
||||||
this.setDate()
|
this.setDate()
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue