From 43d787ff88b063696dabd34a570a63a34b3db990 Mon Sep 17 00:00:00 2001 From: Nico Schmitz Date: Thu, 14 Jun 2018 12:38:15 +0200 Subject: [PATCH] Simplify isOlderThan() --- .../info/nightscout/androidaps/db/CareportalEvent.java | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/app/src/main/java/info/nightscout/androidaps/db/CareportalEvent.java b/app/src/main/java/info/nightscout/androidaps/db/CareportalEvent.java index 25c6cdce13..72ff1ddab0 100644 --- a/app/src/main/java/info/nightscout/androidaps/db/CareportalEvent.java +++ b/app/src/main/java/info/nightscout/androidaps/db/CareportalEvent.java @@ -98,13 +98,7 @@ public class CareportalEvent implements DataPointWithLabelInterface { return diff.get(TimeUnit.DAYS) + " " + MainApp.gs(R.string.days) + " " + diff.get(TimeUnit.HOURS) + " " + MainApp.gs(R.string.hours); } - public boolean isOlderThan(double hours) { - Map diff = computeDiff(date, System.currentTimeMillis()); - if(diff.get(TimeUnit.DAYS)*24 + diff.get(TimeUnit.HOURS) > hours) - return true; - else - return false; - } + public boolean isOlderThan(double hours) { return getHoursFromStart() > hours; } public String log() { return "CareportalEvent{" +