From 3121fa3e8468662dc05290dc275873927ecab84b Mon Sep 17 00:00:00 2001 From: AdrianLxM Date: Sun, 29 Oct 2017 02:07:17 +0200 Subject: [PATCH] use DateUtil#untilString --- .../androidaps/plugins/Overview/OverviewFragment.java | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/Overview/OverviewFragment.java b/app/src/main/java/info/nightscout/androidaps/plugins/Overview/OverviewFragment.java index 47cfa1fc1a..8b08d76dd2 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/Overview/OverviewFragment.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/Overview/OverviewFragment.java @@ -994,14 +994,10 @@ public class OverviewFragment extends Fragment implements View.OnClickListener, // temp target TempTarget tempTarget = MainApp.getConfigBuilder().getTempTargetFromHistory(); if (tempTarget != null) { - long remainingTimeMinutes = (tempTarget.end()- System.currentTimeMillis())/(1000*60); - long remainingTimeHours = remainingTimeMinutes/60; - remainingTimeMinutes = remainingTimeMinutes%60; - String remaining = " (" + ((remainingTimeHours >0)?(remainingTimeHours + "h "):"") + remainingTimeMinutes + "')"; tempTargetView.setTextColor(Color.BLACK); tempTargetView.setBackgroundColor(MainApp.sResources.getColor(R.color.tempTargetBackground)); tempTargetView.setVisibility(View.VISIBLE); - tempTargetView.setText(Profile.toTargetRangeString(tempTarget.low, tempTarget.high, Constants.MGDL, units) + remaining); + tempTargetView.setText(Profile.toTargetRangeString(tempTarget.low, tempTarget.high, Constants.MGDL, units) + " " + DateUtil.untilString(tempTarget.end())); } else { tempTargetView.setTextColor(Color.WHITE); tempTargetView.setBackgroundColor(MainApp.sResources.getColor(R.color.tempTargetDisabledBackground));