diff --git a/public/js/components/Calendar/Weeks.js b/public/js/components/Calendar/Weeks.js index 6a7c32a58..530cfe90e 100644 --- a/public/js/components/Calendar/Weeks.js +++ b/public/js/components/Calendar/Weeks.js @@ -9,11 +9,11 @@ export default { 'focusDate' ], data() { - return { - weeks: [...Array(this.focusDate.numWeeks).keys()].map(i => i+1) - } }, computed: { + weeks(){ + return [...Array(this.focusDate.numWeeks).keys()].map(i => i + 1); + }, title() { return this.focusDate.format({year: 'numeric'}); } @@ -23,11 +23,19 @@ export default { // TODO(chris): test is there a week jump on year select? => yes there is if the same month/day are in different weeks ... should we prevent that? this.focusDate.w = week; this.$emit('updateMode', 'week'); - } + }, + prev(){ + this.focusDate.y--; + this.focusDate._clean(); + }, + next() { + this.focusDate.y++; + this.focusDate._clean(); + }, }, template: `
- +