mirror of
https://github.com/Athou/commafeed.git
synced 2026-03-21 21:37:29 +00:00
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) {
|
||||
Date now = Calendar.getInstance().getTime();
|
||||
if (date == null) {
|
||||
return new Date();
|
||||
return now;
|
||||
}
|
||||
if (date.before(START) || date.after(END)) {
|
||||
return new Date();
|
||||
return now;
|
||||
}
|
||||
|
||||
if (date.after(now)) {
|
||||
return now;
|
||||
}
|
||||
return date;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user