Skip to content

Commit

Permalink
Fix Bug: reminder numbering
Browse files Browse the repository at this point in the history
  • Loading branch information
albertsutz committed Feb 18, 2022
1 parent 38ed9de commit c2bc54d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/main/java/duke/TasksList.java
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,15 @@ public String getTasksUnder(List<String> instructions) throws InvalidArgumentExc
response.append(timeIdentifier + "\n");

StringBuilder deadlineString = new StringBuilder();
int counter = 1;
for (int i = 0; i < tasks.size(); i++) {
if (tasks.get(i).getType() == "Deadline") {
assert tasks.get(i) instanceof Deadline;

Deadline deadline = (Deadline) tasks.get(i);
if (deadline.happensBefore(inputNumber, timeIdentifier)) {
deadlineString.append(String.format((i + 1) + ". " + deadline + "\n"));
deadlineString.append(String.format((counter) + ". " + deadline + "\n"));
counter++;
}

}
Expand Down

0 comments on commit c2bc54d

Please sign in to comment.