From 43e83350bd3e98960fbbfa695c956893661f148c Mon Sep 17 00:00:00 2001 From: kolaente Date: Sat, 5 Feb 2022 21:12:35 +0100 Subject: [PATCH] feat: move logic of ShowTasksInRange component to ShowTasks --- src/views/tasks/ShowTasks.vue | 10 ++++++---- src/views/tasks/ShowTasksInRange.vue | 20 -------------------- src/views/tasks/UpcomingTasks.vue | 9 +++++++++ 3 files changed, 15 insertions(+), 24 deletions(-) delete mode 100644 src/views/tasks/ShowTasksInRange.vue create mode 100644 src/views/tasks/UpcomingTasks.vue diff --git a/src/views/tasks/ShowTasks.vue b/src/views/tasks/ShowTasks.vue index 6333fcb8..ee8f9dcd 100644 --- a/src/views/tasks/ShowTasks.vue +++ b/src/views/tasks/ShowTasks.vue @@ -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' diff --git a/src/views/tasks/ShowTasksInRange.vue b/src/views/tasks/ShowTasksInRange.vue deleted file mode 100644 index 02498cc1..00000000 --- a/src/views/tasks/ShowTasksInRange.vue +++ /dev/null @@ -1,20 +0,0 @@ - - - \ No newline at end of file diff --git a/src/views/tasks/UpcomingTasks.vue b/src/views/tasks/UpcomingTasks.vue new file mode 100644 index 00000000..46b823cb --- /dev/null +++ b/src/views/tasks/UpcomingTasks.vue @@ -0,0 +1,9 @@ + + + \ No newline at end of file