From 6314ca6ec56079762c0b1390aa94b51458a0a988 Mon Sep 17 00:00:00 2001 From: Anton Romanov Date: Wed, 21 Nov 2018 12:46:27 +0400 Subject: [PATCH] notify if paper deadline in future --- .../java/ru/ulstu/paper/service/PaperNotificationService.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/ru/ulstu/paper/service/PaperNotificationService.java b/src/main/java/ru/ulstu/paper/service/PaperNotificationService.java index 736ae87..05f9c2a 100644 --- a/src/main/java/ru/ulstu/paper/service/PaperNotificationService.java +++ b/src/main/java/ru/ulstu/paper/service/PaperNotificationService.java @@ -31,7 +31,8 @@ public class PaperNotificationService { private boolean needToSendDeadlineNotification(Paper paper, Date compareDate, boolean isDeadlineBeforeWeek) { return (paper.getDeadlineDate() != null) && (compareDate.after(paper.getDeadlineDate()) && isDeadlineBeforeWeek - || compareDate.before(paper.getDeadlineDate()) && !isDeadlineBeforeWeek); + || compareDate.before(paper.getDeadlineDate()) && !isDeadlineBeforeWeek) + && paper.getDeadlineDate().after(new Date()); } private void sendMessageDeadline(Paper paper) {