Simplify isOlderThan()
This commit is contained in:
parent
f82240a724
commit
43d787ff88
1 changed files with 1 additions and 7 deletions
|
@ -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);
|
return diff.get(TimeUnit.DAYS) + " " + MainApp.gs(R.string.days) + " " + diff.get(TimeUnit.HOURS) + " " + MainApp.gs(R.string.hours);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isOlderThan(double hours) {
|
public boolean isOlderThan(double hours) { return getHoursFromStart() > 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 String log() {
|
public String log() {
|
||||||
return "CareportalEvent{" +
|
return "CareportalEvent{" +
|
||||||
|
|
Loading…
Reference in a new issue