diff --git a/public/js/components/Calendar/Day.js b/public/js/components/Calendar/Day.js index af6a3d44d..afee386a6 100644 --- a/public/js/components/Calendar/Day.js +++ b/public/js/components/Calendar/Day.js @@ -13,7 +13,7 @@ export default { }, computed: { title() { - return this.focusDate.format({ year: 'numeric' }) + ' KW ' + this.focusDate.w; + return this.focusDate.wYear + ' KW ' + this.focusDate.w; } }, methods: { diff --git a/public/js/components/Calendar/Week.js b/public/js/components/Calendar/Week.js index 9de82ba79..f17a09511 100644 --- a/public/js/components/Calendar/Week.js +++ b/public/js/components/Calendar/Week.js @@ -12,7 +12,7 @@ export default { }, computed: { title() { - return this.focusDate.format({year: 'numeric'}) + ' KW ' + this.focusDate.w; + return this.focusDate.wYear + ' KW ' + this.focusDate.w; } }, methods: { diff --git a/public/js/composables/CalendarDate.js b/public/js/composables/CalendarDate.js index 19d53fe5e..d71b22963 100644 --- a/public/js/composables/CalendarDate.js +++ b/public/js/composables/CalendarDate.js @@ -49,6 +49,12 @@ class CalendarDate { } } } + get wYear() { + if( this.w === 1 ) { + return this.cdLastDayOfWeek.format({ year: 'numeric' }); + } + return this.cdFirstDayOfWeek.format({ year: 'numeric' }); + } get wd() { if (this._wd === null) { this._wd = ((new Date(this.y, this.m, this.d)).getDay()+7-this.weekStart)%7;