Parcourir la source

Improve time remaining string for <12 hrs #865

Deniz Cengiz il y a 5 mois
Parent
commit
b4b1039465
1 fichiers modifiés avec 6 ajouts et 1 suppressions
  1. 6 1
      Trio/Sources/Modules/Home/View/Header/PumpView.swift

+ 6 - 1
Trio/Sources/Modules/Home/View/Header/PumpView.swift

@@ -142,7 +142,12 @@ struct PumpView: View {
         }
 
         if hours >= 1 {
-            return "\(hours)" + String(localized: "h", comment: "abbreviation for hours")
+            var remainingHoursString = "\(hours)" + String(localized: "h", comment: "abbreviation for hours")
+            if hours < 12 {
+                remainingHoursString += " " + "\(minutes)" +
+                String(localized: "m", comment: "abbreviation for minutes")
+            }
+            return remainingHoursString
         }
 
         return "\(minutes)" + String(localized: "m", comment: "abbreviation for minutes")