Move next week/next month task overview pages into a single "Upcoming" page and allow toggle
This commit is contained in:
parent
ed40249bb3
commit
5d995a2758
4 changed files with 22 additions and 25 deletions
|
|
@ -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)
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
|
|||
Reference in a new issue