feat: move logic of ShowTasksInRange component to ShowTasks
This commit is contained in:
parent
c41397f5db
commit
43e83350bd
3 changed files with 15 additions and 24 deletions
|
@ -47,6 +47,10 @@ import {LOADING, LOADING_MODULE} from '@/store/mutation-types'
|
|||
import LlamaCool from '@/assets/llama-cool.svg?component'
|
||||
import DatepickerWithRange from '@/components/date/datepickerWithRange'
|
||||
|
||||
function getNextWeekDate() {
|
||||
return new Date((new Date()).getTime() + 7 * 24 * 60 * 60 * 1000)
|
||||
}
|
||||
|
||||
export default {
|
||||
name: 'ShowTasks',
|
||||
components: {
|
||||
|
@ -62,8 +66,6 @@ export default {
|
|||
}
|
||||
},
|
||||
props: {
|
||||
startDate: Date,
|
||||
endDate: Date,
|
||||
showAll: Boolean,
|
||||
},
|
||||
created() {
|
||||
|
@ -84,14 +86,14 @@ export default {
|
|||
|
||||
return !isNaN(d)
|
||||
? d
|
||||
: this.startDate
|
||||
: new Date()
|
||||
},
|
||||
dateTo() {
|
||||
const d = new Date(Number(this.$route.query.to))
|
||||
|
||||
return !isNaN(d)
|
||||
? d
|
||||
: this.endDate
|
||||
: getNextWeekDate()
|
||||
},
|
||||
showNulls() {
|
||||
return this.$route.query.showNulls === 'true'
|
||||
|
|
|
@ -1,20 +0,0 @@
|
|||
<template>
|
||||
<div class="content has-text-centered">
|
||||
<ShowTasks
|
||||
:end-date="endDate"
|
||||
:start-date="startDate"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref } from 'vue'
|
||||
import ShowTasks from './ShowTasks.vue'
|
||||
|
||||
function getNextWeekDate() {
|
||||
return new Date((new Date()).getTime() + 7 * 24 * 60 * 60 * 1000)
|
||||
}
|
||||
|
||||
const startDate = ref(new Date())
|
||||
const endDate = ref(getNextWeekDate())
|
||||
</script>
|
9
src/views/tasks/UpcomingTasks.vue
Normal file
9
src/views/tasks/UpcomingTasks.vue
Normal file
|
@ -0,0 +1,9 @@
|
|||
<template>
|
||||
<div class="content has-text-centered">
|
||||
<ShowTasks/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import ShowTasks from './ShowTasks.vue'
|
||||
</script>
|
Loading…
Reference in a new issue