change age(int) to boolean isOldetThan()

This commit is contained in:
Roumen Georgiev 2018-04-04 09:35:45 +03:00 committed by GitHub
parent ddf39e8d55
commit d50f31e7a6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -98,18 +98,12 @@ public class CareportalEvent implements DataPointWithLabelInterface {
return diff.get(TimeUnit.DAYS) + " " + MainApp.sResources.getString(R.string.days) + " " + diff.get(TimeUnit.HOURS) + " " + MainApp.sResources.getString(R.string.hours);
}
public String age(int threshold) {
public boolean isOlderThan(int threshold) {
Map<TimeUnit, Long> diff = computeDiff(date, System.currentTimeMillis());
if (OverviewFragment.shorttextmode)
if(diff.get(TimeUnit.DAYS) > threshold)
return "isOLD"+diff.get(TimeUnit.DAYS) +"d" + diff.get(TimeUnit.HOURS) + "h";
return true;
else
return diff.get(TimeUnit.DAYS) +"d" + diff.get(TimeUnit.HOURS) + "h";
else
if(diff.get(TimeUnit.DAYS) > threshold)
return "isOLD"+diff.get(TimeUnit.DAYS) + " " + MainApp.sResources.getString(R.string.days) + " " + diff.get(TimeUnit.HOURS) + " " + MainApp.sResources.getString(R.string.hours);
else
return diff.get(TimeUnit.DAYS) + " " + MainApp.sResources.getString(R.string.days) + " " + diff.get(TimeUnit.HOURS) + " " + MainApp.sResources.getString(R.string.hours);
return false;
}
public String log() {