use DateUtil#agoString

This commit is contained in:
AdrianLxM 2017-10-29 02:08:43 +02:00 committed by GitHub
parent 3121fa3e84
commit f9ed104fe3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -226,7 +226,7 @@ public class DanaRFragment extends SubscriberFragment {
Long agoMsec = System.currentTimeMillis() - pump.lastBolusTime.getTime(); Long agoMsec = System.currentTimeMillis() - pump.lastBolusTime.getTime();
double agoHours = agoMsec / 60d / 60d / 1000d; double agoHours = agoMsec / 60d / 60d / 1000d;
if (agoHours < 6) // max 6h back if (agoHours < 6) // max 6h back
lastBolusView.setText(DateUtil.timeString(pump.lastBolusTime) + " (" + DecimalFormatter.to1Decimal(agoHours) + " " + MainApp.sResources.getString(R.string.hoursago) + ") " + DecimalFormatter.to2Decimal(DanaRPump.getInstance().lastBolusAmount) + " U"); lastBolusView.setText(DateUtil.timeString(pump.lastBolusTime) + " " + DateUtil.sinceString(pump.lastBolusTime.getTime()) + " " + DecimalFormatter.to2Decimal(DanaRPump.getInstance().lastBolusAmount) + " U");
else lastBolusView.setText(""); else lastBolusView.setText("");
} }