Simplify isOlderThan()

This commit is contained in:
Nico Schmitz 2018-06-14 12:38:15 +02:00
parent f82240a724
commit 43d787ff88

View file

@ -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<TimeUnit, Long> 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{" +