|
@@ -137,12 +137,11 @@ extension MainViewController {
|
|
|
//if i == tempArray.count - 1 && dateTimeStamp + duration <= dateTimeUtils.getNowTimeIntervalUTC() {
|
|
//if i == tempArray.count - 1 && dateTimeStamp + duration <= dateTimeUtils.getNowTimeIntervalUTC() {
|
|
|
if i == tempArray.count - 1 && duration == 0.0 {
|
|
if i == tempArray.count - 1 && duration == 0.0 {
|
|
|
lastEndDot = dateTimeStamp + (30 * 60)
|
|
lastEndDot = dateTimeStamp + (30 * 60)
|
|
|
- latestBasal = String(format:"%.2f", basalRate)
|
|
|
|
|
} else {
|
|
} else {
|
|
|
lastEndDot = dateTimeStamp + (duration * 60)
|
|
lastEndDot = dateTimeStamp + (duration * 60)
|
|
|
- latestBasal = String(format:"%.2f", basalRate)
|
|
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+ latestBasal = Localizer.formatToLocalizedString(basalRate, maxFractionDigits: 2, minFractionDigits: 0)
|
|
|
|
|
+
|
|
|
// Double check for overlaps of incorrectly ended TBRs and sent it to end when the next one starts if it finds a discrepancy
|
|
// Double check for overlaps of incorrectly ended TBRs and sent it to end when the next one starts if it finds a discrepancy
|
|
|
if i < tempArray.count - 1 {
|
|
if i < tempArray.count - 1 {
|
|
|
let nextEntry = tempArray[i + 1] as [String : AnyObject]?
|
|
let nextEntry = tempArray[i + 1] as [String : AnyObject]?
|
|
@@ -187,7 +186,7 @@ extension MainViewController {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- latestBasal = String(format:"%.2f", scheduled)
|
|
|
|
|
|
|
+ latestBasal = Localizer.formatToLocalizedString(scheduled, maxFractionDigits: 2, minFractionDigits: 0)
|
|
|
// Make the starting dot at the last ending dot
|
|
// Make the starting dot at the last ending dot
|
|
|
let startDot = basalGraphStruct(basalRate: scheduled, date: Double(lastEndDot))
|
|
let startDot = basalGraphStruct(basalRate: scheduled, date: Double(lastEndDot))
|
|
|
basalData.append(startDot)
|
|
basalData.append(startDot)
|
|
@@ -200,6 +199,10 @@ extension MainViewController {
|
|
|
if UserDefaultsRepository.graphBasal.value {
|
|
if UserDefaultsRepository.graphBasal.value {
|
|
|
updateBasalGraph()
|
|
updateBasalGraph()
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ if let profileBasal = profileManager.currentBasal(), profileBasal != latestBasal {
|
|
|
|
|
+ latestBasal = "\(profileBasal) → \(latestBasal)"
|
|
|
|
|
+ }
|
|
|
infoManager.updateInfoData(type: .basal, value: latestBasal)
|
|
infoManager.updateInfoData(type: .basal, value: latestBasal)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|