Skip to content

Commit

Permalink
Fix Bug
Browse files Browse the repository at this point in the history
  • Loading branch information
shishirbychapur committed Sep 21, 2023
1 parent c49310b commit 75f84df
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion data/tasks.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
T | O | eat apple
D | O | Complete CS2100 Assignment | Sep 18 2023 01:15 PM
D | X | Complete CS2100 Assignment | Sep 18 2023 01:15 PM
E | O | Play Tennis | Sep 25 2023 05:00 PM - Sep 25 2023 07:00 PM
T | O | Learn JavaFX
2 changes: 1 addition & 1 deletion src/main/java/jarvis/exceptions/ExceptionMessages.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class ExceptionMessages {
public static final String INVALID_RANGE = "Please ensure that the date range is valid!";
public static final String INVALID_TASK = "Please ensure that the task is valid (Event/Todo/Deadline)";
public static final String INVALID_MARK = "I'm unable to perform the mark/unmark operation because the task"
+ "is already marked/unmarked!";
+ " is already marked/unmarked!";
public static final String FILE_DOESNT_EXIST = "The file doesn't exist yet, but will be created under the path (";
public static final String INVALID_INPUT = "Incorrect input has been detected from the file stored at the path (";

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/jarvis/tasks/Deadline.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,6 @@ public String toFile() {
* @return True if the deadline has passed, false otherwise.
*/
public boolean hasPassed() {
return this.deadline.isBefore(LocalDateTime.now()) && !this.isCompleted();
return this.deadline.isBefore(LocalDateTime.now());
}
}
2 changes: 1 addition & 1 deletion src/main/java/jarvis/tasks/Event.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,6 @@ public String toFile() {
* @return True if the event has started, false otherwise.
*/
public boolean hasPassed() {
return this.from.isBefore(LocalDateTime.now()) && !this.isCompleted();
return this.from.isBefore(LocalDateTime.now());
}
}
4 changes: 2 additions & 2 deletions src/main/java/jarvis/tasks/TaskList.java
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,10 @@ public String getPendingTasks() {
for (Task t : this.tasks) {
if (t instanceof Todo) {
continue;
} else if (t.hasPassed()) {
} else if (t.hasPassed() && !t.isCompleted()) {
passedTasks.append(passedCount + 1).append(") ").append(t).append("\n");
passedCount++;
} else if (!t.hasPassed()) {
} else if (!t.hasPassed() && !t.isCompleted()) {
currentTasks.append(currentCount + 1).append(") ").append(t).append("\n");
currentCount++;
}
Expand Down

0 comments on commit 75f84df

Please sign in to comment.