Skip to content

Commit

Permalink
Merge pull request #179 from blimyj/fix-redo-reminder
Browse files Browse the repository at this point in the history
Fix redo reminder
  • Loading branch information
Icesiolz authored Oct 31, 2019
2 parents 3936e50 + 6f45cad commit 96050f4
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
14 changes: 12 additions & 2 deletions docs/UserGuide.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,18 @@ Examples:

=== Snoozing a reminder: `snooze`

Snoozes a reminder.
Format:
Snoozes a reminder that occurred since the application was open. +
If an index is not provided, the most recently occurred reminder will be snoozed. +
If a snooze duration is not specified, the reminder will be snoozed at the default duration of 5 min. +
Format: 'snooze [INDEX] [-s SNOOZE_DURATION]' +

Examples:
* `snooze 1`
* `snooze 3 -s 10.min.later`
* `snooze -s 10/10/2020`

[NOTE]
It is not possible to snooze if no reminder has occurred yet.

=== Show the specified category : `show`

Expand Down
10 changes: 9 additions & 1 deletion src/main/java/seedu/elisa/model/ItemModelManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,11 @@ public void addToSeparateList(Item item) {

if (item.hasReminder()) {
reminderList.add(item);
futureReminders.add(item);
if (item.getReminder().get().getOccurrenceDateTime().isAfter(LocalDateTime.now())) {
futureReminders.add(item);
} else {
activeReminders.add(item);
}
}
}

Expand Down Expand Up @@ -259,6 +263,8 @@ public Item removeItem(Item item) {
taskList.remove(item);
eventList.remove(item);
reminderList.remove(item);
futureReminders.remove(item);
activeReminders.remove(item);
return item;
}

Expand All @@ -273,6 +279,8 @@ public Item deleteItem(int index) {
taskList.remove(item);
eventList.remove(item);
reminderList.remove(item);
futureReminders.remove(item);
activeReminders.remove(item);
if (priorityMode.getValue()) {
getNextTask();
}
Expand Down

0 comments on commit 96050f4

Please sign in to comment.