Merge pull request #1400 from Philoul/Fix/targetUnitsProfileViewerDialog

Fix target units in profile Viewer Dialog for Compare Profile
This commit is contained in:
Milos Kozak 2022-03-01 12:36:16 +01:00 committed by GitHub
commit cd0ec5ef24
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -293,8 +293,8 @@ class ProfileViewerDialog : DaggerDialogFragment() {
val val1h = profile1.getTargetHighMgdlTimeFromMidnight(hour * 60 * 60)
val val2l = profile2.getTargetLowMgdlTimeFromMidnight(hour * 60 * 60)
val val2h = profile2.getTargetHighMgdlTimeFromMidnight(hour * 60 * 60)
val txt1 = dateUtil.format_HH_MM(hour * 60 * 60) + " " + Profile.toUnitsString(val1l, val1l * Constants.MGDL_TO_MMOLL, units) + " - " + Profile.toUnitsString(val1h, val1h * Constants.MGDL_TO_MMOLL, units) + " " + units
val txt2 = dateUtil.format_HH_MM(hour * 60 * 60) + " " + Profile.toUnitsString(val2l, val2l * Constants.MGDL_TO_MMOLL, units) + " - " + Profile.toUnitsString(val2h, val2h * Constants.MGDL_TO_MMOLL, units) + " " + units
val txt1 = dateUtil.format_HH_MM(hour * 60 * 60) + " " + Profile.toUnitsString(val1l, val1l * Constants.MGDL_TO_MMOLL, units) + " - " + Profile.toUnitsString(val1h, val1h * Constants.MGDL_TO_MMOLL, units) + " " + units.asText
val txt2 = dateUtil.format_HH_MM(hour * 60 * 60) + " " + Profile.toUnitsString(val2l, val2l * Constants.MGDL_TO_MMOLL, units) + " - " + Profile.toUnitsString(val2h, val2h * Constants.MGDL_TO_MMOLL, units) + " " + units.asText
if (val1l != prev1l || val1h != prev1h || val2l != prev2l || val2h != prev2h) {
s.append(formatColors(txt1, txt2))
s.append("<br>")