2018-12-25 23:41:55 +01:00
|
|
|
<template>
|
|
|
|
<div class="content has-text-centered">
|
2020-05-12 15:08:17 +02:00
|
|
|
<ShowTasks
|
2018-12-25 23:41:55 +01:00
|
|
|
:start-date="startDate"
|
|
|
|
:end-date="endDate"
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2020-05-12 15:08:17 +02:00
|
|
|
import ShowTasks from './ShowTasks'
|
|
|
|
|
2018-12-25 23:41:55 +01:00
|
|
|
export default {
|
2020-05-12 15:08:17 +02:00
|
|
|
name: 'ShowTasksInRange',
|
|
|
|
components: {
|
|
|
|
ShowTasks,
|
|
|
|
},
|
2018-12-25 23:41:55 +01:00
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
startDate: new Date(this.$route.params.startDateUnix),
|
|
|
|
endDate: new Date(this.$route.params.endDateUnix),
|
|
|
|
}
|
|
|
|
},
|
|
|
|
watch: {
|
|
|
|
// call again the method if the route changes
|
|
|
|
'$route': 'setDates'
|
|
|
|
},
|
|
|
|
created() {
|
|
|
|
this.setDates();
|
|
|
|
},
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|