forked from Archives/Athou_commafeed
make sure the date is in the past
This commit is contained in:
@@ -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;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user