make sure the date is in the past

This commit is contained in:
Athou
2013-06-08 22:00:22 +02:00
parent 56c0e7f6e2
commit d820d9738e

View File

@@ -160,11 +160,16 @@ public class FeedParser {
} }
private Date validateDate(Date date) { private Date validateDate(Date date) {
Date now = Calendar.getInstance().getTime();
if (date == null) { if (date == null) {
return new Date(); return now;
} }
if (date.before(START) || date.after(END)) { if (date.before(START) || date.after(END)) {
return new Date(); return now;
}
if (date.after(now)) {
return now;
} }
return date; return date;
} }