iOS: Am Ablauftag 'heute' statt '0 Tage'

Die Uebersichtskarte 'Bald ablaufend' zeigte am Ablauftag '0 Tage'.
Jetzt gemeinsame Formulierung auf ExpiringItem.restlaufzeitText:
abgelaufen / heute / morgen / X Tage - Karte und volle Liste identisch.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Scarriffle
2026-08-02 16:40:29 +02:00
parent 6ddf6024f7
commit 63ee9608af
3 changed files with 11 additions and 7 deletions

View File

@@ -146,7 +146,7 @@ struct ExpiringView: View {
.font(.caption).foregroundStyle(.secondary)
}
Spacer()
Text(restText(item.daysLeft))
Text(item.restlaufzeitText)
.font(.caption).bold()
.foregroundStyle(item.daysLeft < 0 ? .red : .orange)
}
@@ -181,11 +181,6 @@ struct ExpiringView: View {
return "\(formatAmount(item.quantity / faktor)) \(item.unitName)"
}
private func restText(_ days: Int) -> String {
if days < 0 { return "abgelaufen" }
if days == 0 { return "heute" }
return days == 1 ? "1 Tag" : "\(days) Tage"
}
}
// MARK: - Mindestbestände