* only recognize positive {age} (in days) values

This commit is contained in:
Reinhard Pointner 2015-05-28 16:39:57 +00:00
parent bd81291ca5
commit 6c1bbae431
1 changed files with 4 additions and 1 deletions

View File

@ -185,7 +185,10 @@ public class MediaBindingBean {
public Number getAgeInDays() {
SimpleDate releaseDate = getReleaseDate();
if (releaseDate != null) {
return TimeUnit.MILLISECONDS.toDays(System.currentTimeMillis() - releaseDate.getTimeStamp());
long days = TimeUnit.MILLISECONDS.toDays(System.currentTimeMillis() - releaseDate.getTimeStamp());
if (days >= 0) {
return days;
}
}
return null;
}