diff --git a/src/components/date/datepickerWithRange.vue b/src/components/date/datepickerWithRange.vue
new file mode 100644
index 00000000..1a406340
--- /dev/null
+++ b/src/components/date/datepickerWithRange.vue
@@ -0,0 +1,134 @@
+
+
+
+
+
+ {{ dateRange }}
+
+
+
+
+
+
+
diff --git a/src/views/tasks/ShowTasks.vue b/src/views/tasks/ShowTasks.vue
index 89a7a182..6328ab0c 100644
--- a/src/views/tasks/ShowTasks.vue
+++ b/src/views/tasks/ShowTasks.vue
@@ -12,7 +12,7 @@
{{ pageTitle }}
-
+
{{ $t('task.show.select') }}
+
@@ -62,6 +63,7 @@ import Fancycheckbox from '@/components/input/fancycheckbox'
import {LOADING, LOADING_MODULE} from '@/store/mutation-types'
import LlamaCool from '@/assets/llama-cool.svg?component'
+import DatepickerWithRange from '@/components/date/datepickerWithRange'
function formatDate(date) {
return `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()} ${date.getHours()}:${date.getMinutes()}`
@@ -70,6 +72,7 @@ function formatDate(date) {
export default {
name: 'ShowTasks',
components: {
+ DatepickerWithRange,
Fancycheckbox,
SingleTaskInList,
flatPickr,
@@ -81,6 +84,7 @@ export default {
showNulls: true,
showOverdue: false,
+ // TODO: Set the date range based on the default (to make sure it shows up in the picker) -> maybe also use a computed which depends on dateFrom and dateTo?
dateRange: null,
showNothingToDo: false,
@@ -150,18 +154,12 @@ export default {
}),
},
methods: {
- setDate() {
- if (this.dateRange === null) {
- return
- }
-
- const [fromDate, toDate] = this.dateRange.split(' to ')
-
+ setDate({dateFrom, dateTo}) {
this.$router.push({
name: this.$route.name,
query: {
- from: +new Date(fromDate),
- to: +new Date(toDate),
+ from: +new Date(dateFrom),
+ to: +new Date(dateTo),
showOverdue: this.showOverdue,
showNulls: this.showNulls,
},