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

@@ -504,6 +504,15 @@ struct ExpiringItem: Codable, Identifiable {
var id: Int { lotId }
/// Restlaufzeit als kurzer Text. 0 Tage" ergibt keinen Sinn - am Ablauftag
/// selbst steht heute". Karte und Liste nutzen dieselbe Formulierung.
var restlaufzeitText: String {
if daysLeft < 0 { return "abgelaufen" }
if daysLeft == 0 { return "heute" }
if daysLeft == 1 { return "morgen" }
return "\(daysLeft) Tage"
}
enum CodingKeys: String, CodingKey {
case quantity
case lotId = "lot_id"