diff --git a/frontend/src/components/DashboardWidget.vue b/frontend/src/components/DashboardWidget.vue index 1e16668..990b0bf 100644 --- a/frontend/src/components/DashboardWidget.vue +++ b/frontend/src/components/DashboardWidget.vue @@ -122,10 +122,16 @@ export default { return t === key ? this.$t(`general.gender.${g}`) || g : t; }, falukantAgeLabel() { - const days = this.falukantData?.age; - if (days == null) return '—'; - const years = Math.floor(Number(days) / 365); - return `${years} ${this.$t('falukant.overview.metadata.years')}`; + const ageValue = this.falukantData?.age; + if (ageValue == null) return '—'; + 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')}`; + } }, dataList() { if (!Array.isArray(this.data) || this.data.length === 0) return []; diff --git a/frontend/src/i18n/locales/de/falukant.json b/frontend/src/i18n/locales/de/falukant.json index 0a442b9..af976c9 100644 --- a/frontend/src/i18n/locales/de/falukant.json +++ b/frontend/src/i18n/locales/de/falukant.json @@ -120,6 +120,7 @@ "money": "Vermögen", "age": "Alter", "years": "Jahre", + "days": "Tage", "mainbranch": "Heimatstadt", "nobleTitle": "Stand" }, diff --git a/frontend/src/i18n/locales/en/falukant.json b/frontend/src/i18n/locales/en/falukant.json index 03e4ab2..2d06f38 100644 --- a/frontend/src/i18n/locales/en/falukant.json +++ b/frontend/src/i18n/locales/en/falukant.json @@ -101,6 +101,7 @@ "money": "Wealth", "age": "Age", "years": "Years", + "days": "Days", "mainbranch": "Home city", "nobleTitle": "Title" }