diff --git a/src/components/home/navigation.vue b/src/components/home/navigation.vue
index ae8c8ef7..314c194f 100644
--- a/src/components/home/navigation.vue
+++ b/src/components/home/navigation.vue
@@ -14,19 +14,11 @@
-
-
-
-
- Next Week
-
-
-
-
+
- Next Month
+ Upcoming
diff --git a/src/router/index.js b/src/router/index.js
index 981bd97f..ed6e63fc 100644
--- a/src/router/index.js
+++ b/src/router/index.js
@@ -181,7 +181,7 @@ export default new Router({
component: TaskDetailView,
},
{
- path: '/tasks/by/:type',
+ path: '/tasks/by/upcoming',
name: 'tasks.range',
component: ShowTasksInRangeComponent,
},
diff --git a/src/views/tasks/ShowTasks.vue b/src/views/tasks/ShowTasks.vue
index 42855b00..ee18d08b 100644
--- a/src/views/tasks/ShowTasks.vue
+++ b/src/views/tasks/ShowTasks.vue
@@ -29,6 +29,10 @@
v-model="cEndDate"
/>
+
Nothing to do - Have a nice day!
@@ -181,6 +185,16 @@ export default {
}
}
},
+ setDatesToNextWeek() {
+ this.cStartDate = new Date()
+ this.cEndDate = new Date((new Date()).getTime() + 7 * 24 * 60 * 60 * 1000)
+ this.loadPendingTasks()
+ },
+ setDatesToNextMonth() {
+ this.cStartDate = new Date()
+ this.cEndDate = new Date((new Date()).setMonth((new Date()).getMonth() + 1))
+ this.loadPendingTasks()
+ },
},
}
diff --git a/src/views/tasks/ShowTasksInRange.vue b/src/views/tasks/ShowTasksInRange.vue
index 1ed27871..e24e1b45 100644
--- a/src/views/tasks/ShowTasksInRange.vue
+++ b/src/views/tasks/ShowTasksInRange.vue
@@ -22,24 +22,15 @@ export default {
}
},
watch: {
- // call again the method if the route changes
- '$route': 'setDates',
+ '$route': 'setDatesToNextWeek',
},
created() {
- this.setDates()
+ this.setDatesToNextWeek()
},
methods: {
- setDates() {
- switch (this.$route.params.type) {
- case 'week':
- this.startDate = new Date()
- this.endDate = new Date((new Date()).getTime() + 7 * 24 * 60 * 60 * 1000)
- break
- case 'month':
- this.startDate = new Date()
- this.endDate = new Date((new Date()).setMonth((new Date()).getMonth() + 1))
- break
- }
+ setDatesToNextWeek() {
+ this.startDate = new Date()
+ this.endDate = new Date((new Date()).getTime() + 7 * 24 * 60 * 60 * 1000)
},
},
}