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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user