Skip to content

Commit

Permalink
Cleaned up code
Browse files Browse the repository at this point in the history
  • Loading branch information
yulonglim committed Oct 11, 2021
1 parent 3639cac commit b022b4f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/main/java/duke/Controller.java
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,8 @@ public void add(ActionEvent a) {
tasks.addTask(taskParse(taskType.getText(), taskDescription.getText(), ""));
this.save();
assert addTaskError.getText().equals("");
} else if (taskType.getText().equalsIgnoreCase("D") || taskType.getText().equalsIgnoreCase("E")) {
} else if (taskType.getText().equalsIgnoreCase("D")
|| taskType.getText().equalsIgnoreCase("E")) {
if (taskDate.getValue() == null) {
addTaskError.setText("Add a Date!");
} else {
Expand Down
6 changes: 4 additions & 2 deletions src/main/java/duke/Task.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ public void markAsDone() {
/**
* Marks task as not done
*/
public void markUndone() { this.isDone = false; }
public void markUndone() {
this.isDone = false;
}

/**
* Changes description of task
Expand All @@ -42,7 +44,7 @@ public void markAsDone() {
public void changeDescription(String description) {
this.description = description;
}

@Override
public String toString() {
return String.format("[%s] %s", this.getStatusIcon(), this.description);
Expand Down

0 comments on commit b022b4f

Please sign in to comment.