Skip to content

Commit

Permalink
Merge pull request #2 from rgonslayer/Level-8
Browse files Browse the repository at this point in the history
Level-8
  • Loading branch information
rgonslayer authored Sep 1, 2022
2 parents 252257c + a5f47e8 commit 4f468dc
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 6 deletions.
1 change: 1 addition & 0 deletions data/taskList.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
T | 0 | read book
9 changes: 6 additions & 3 deletions src/main/java/Deadline.java
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.time.temporal.ChronoUnit;
public class Deadline extends Task{
protected String by;
protected LocalDate by;

public Deadline(String description, String date) {
super(description);
this.by = date;
this.by = LocalDate.parse(date);
}

@Override
public String toString() {
return "[D]" + super.toString() + " (by: " + by + ")";
return "[D]" + super.toString() + " (by: " + by.format(DateTimeFormatter.ofPattern("MMM d yyyy")) + ")";
}
}
10 changes: 7 additions & 3 deletions src/main/java/Event.java
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.time.temporal.ChronoUnit;

public class Event extends Task{

protected String at;
protected LocalDate at;

public Event(String description, String date) {
super(description);
this.at = date;
this.at = LocalDate.parse(date);
}

@Override
public String toString() {
return "[E]" + super.toString() + " (at: " + at + ")";
return "[E]" + super.toString() + " (at: " + at.format(DateTimeFormatter.ofPattern("MMM d yyyy")) + ")";
}
}
4 changes: 4 additions & 0 deletions src/main/java/ToDo.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.time.temporal.ChronoUnit;

public class ToDo extends Task{

public ToDo(String description) {
Expand Down

0 comments on commit 4f468dc

Please sign in to comment.