瀏覽代碼

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

Improve time remaining string for <12 hrs #865
Mike Plante 5 月之前
父節點
當前提交
b677cd0449
共有 1 個文件被更改,包括 6 次插入1 次删除
  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")