Przeglądaj źródła

Fix for freeAPS ms in bolus timestamp

Jon Fawcett 6 lat temu
rodzic
commit
8968e3c3c5
1 zmienionych plików z 3 dodań i 1 usunięć
  1. 3 1
      LoopFollow/Controllers/NightScout.swift

+ 3 - 1
LoopFollow/Controllers/NightScout.swift

@@ -1015,7 +1015,9 @@ extension MainViewController {
                 return
             }
             
-            let strippedZone = String(bolusDate.dropLast())
+            // fix to remove millisecond (after period in timestamp) for FreeAPS users
+            var strippedZone = String(bolusDate.dropLast())
+            strippedZone = strippedZone.components(separatedBy: ".")[0]
             let dateFormatter = DateFormatter()
             dateFormatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ss"
             dateFormatter.locale = Locale(identifier: "en_US")