Browse Source

Merge pull request #872 from nightscout/time-remaining-display-865

Improve time remaining string for <12 hrs #865
Mike Plante 5 tháng trước cách đây
mục cha
commit
b677cd0449
1 tập tin đã thay đổi với 6 bổ sung1 xóa
  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")