Refactor age display logic in DashboardWidget: Simplify age representation to always show years, removing the conditional check for days. This change streamlines the age display functionality.

This commit is contained in:
Torsten Schulz (local)
2026-01-30 13:34:02 +01:00
parent ae71a066c7
commit 3870f34ef8
2 changed files with 34 additions and 37 deletions

View File

@@ -127,11 +127,7 @@ export default {
const numAge = Number(ageValue);
// Backend gibt Tage zurück (calcAge verwendet differenceInDays)
// Wenn < 365 Tage: Tage anzeigen, sonst Jahre
if (numAge < 365) {
return `${numAge} ${this.$t('falukant.overview.metadata.days')}`;
} else {
return `${numAge} ${this.$t('falukant.overview.metadata.years')}`;
}
return `${numAge} ${this.$t('falukant.overview.metadata.years')}`;
},
dataList() {
if (!Array.isArray(this.data) || this.data.length === 0) return [];