Skip to content

Commit

Permalink
Implement coding standard.
Browse files Browse the repository at this point in the history
  • Loading branch information
QianChangru committed Sep 10, 2023
1 parent cb8b5d6 commit a011a9e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
6 changes: 4 additions & 2 deletions src/main/java/duke/Deadline.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ public Deadline(String description, boolean isDone, LocalDate by) {
@Override
public String toString() {
return "[D]" + super.toString() + " (by: "
+ this.by.format(DateTimeFormatter.ofPattern("MMM dd yyyy", Locale.ENGLISH)) + ")";
+ this.by.format(DateTimeFormatter.ofPattern("MMM dd yyyy", Locale.ENGLISH))
+ ")";
}

/**
Expand All @@ -32,6 +33,7 @@ public String toString() {
@Override
public String toTxt() {
return "D | " + super.toTxt()
+ " | " + this.by.format(DateTimeFormatter.ofPattern("MMM dd yyyy", Locale.ENGLISH));
+ " | "
+ this.by.format(DateTimeFormatter.ofPattern("MMM dd yyyy", Locale.ENGLISH));
}
}
9 changes: 6 additions & 3 deletions src/main/java/duke/Event.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,19 @@ public Event(String description, boolean isDone, LocalDate startTime, LocalDate

@Override
public String toString() {
return "[E]" + super.toString() + " (from: " + startTime.format(DateTimeFormatter.ofPattern("MMM dd yyyy", Locale.ENGLISH))
+ " to: " + endTime.format(DateTimeFormatter.ofPattern("MMM dd yyyy", Locale.ENGLISH)) + ")";
return "[E]" + super.toString() + " (from: "
+ startTime.format(DateTimeFormatter.ofPattern("MMM dd yyyy", Locale.ENGLISH))
+ " to: "
+ endTime.format(DateTimeFormatter.ofPattern("MMM dd yyyy", Locale.ENGLISH)) + ")";
}

/**
* Returns a String representation of the task for storage.
*/
@Override
public String toTxt() {
return "E | " + super.toTxt() + " | " + this.startTime.format(DateTimeFormatter.ofPattern("MMM dd yyyy", Locale.ENGLISH))
return "E | " + super.toTxt() + " | "
+ this.startTime.format(DateTimeFormatter.ofPattern("MMM dd yyyy", Locale.ENGLISH))
+ " | " + this.endTime.format(DateTimeFormatter.ofPattern("MMM dd yyyy", Locale.ENGLISH));
}
}

0 comments on commit a011a9e

Please sign in to comment.