forked from nus-cs2103-AY2324S1/ip
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Level 8 - deadline tasks now take in deadlines in YYYY/MM/DD format
- Loading branch information
1 parent
38d4be0
commit d2a5f97
Showing
3 changed files
with
36 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,28 @@ | ||
import java.time.LocalDate; | ||
import java.time.format.DateTimeFormatter; | ||
public class Deadline extends Tasks { | ||
private String deadline; | ||
private LocalDate deadline; | ||
|
||
public Deadline(String name, boolean isMarked, String deadline) { | ||
|
||
|
||
public Deadline(String name, boolean isMarked, LocalDate deadline) { | ||
super(name, isMarked); | ||
this.deadline = deadline; | ||
} | ||
|
||
public String getDeadline() { | ||
|
||
|
||
public LocalDate getDeadline() { | ||
return deadline; | ||
} | ||
|
||
public void setDeadline(String deadline) { | ||
public void setDeadline(LocalDate deadline) { | ||
this.deadline = deadline; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
String status = isMarked ? "[X]" : "[ ]"; | ||
return "[D]" + status + " " + name + " (by: " + deadline + ")"; | ||
return "[D]" + status + " " + name + " (by: " + deadline.format(DateTimeFormatter.ofPattern("MMM d yyyy")) + ")"; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters