possible fix for kw 1 issue

This commit is contained in:
Harald Bamberger
2025-01-07 17:09:07 +01:00
parent 46914e8a65
commit e432501a1f
3 changed files with 8 additions and 2 deletions
+1 -1
View File
@@ -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: {
+1 -1
View File
@@ -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: {
+6
View File
@@ -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;