Skip to content

Commit a626b2c

Browse files
committed
Update BGData.swift
Fix dataString unreliability issue
1 parent a608efd commit a626b2c

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

LoopFollow/Controllers/Nightscout/BGData.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,9 @@ extension MainViewController {
5151
}
5252

5353
var parameters: [String: String] = [:]
54-
let utcISODateFormatter = ISO8601DateFormatter()
5554
let date = Calendar.current.date(byAdding: .day, value: -1 * Storage.shared.downloadDays.value, to: Date())!
5655
parameters["count"] = "\(Storage.shared.downloadDays.value * 2 * 24 * 60 / 5)"
57-
parameters["find[dateString][$gte]"] = utcISODateFormatter.string(from: date)
56+
parameters["find[date][$gte]"] = "\(Int(date.timeIntervalSince1970 * 1000))"
5857

5958
// Exclude 'cal' entries
6059
parameters["find[type][$ne]"] = "cal"

0 commit comments

Comments
 (0)