forked from nus-cs2103-AY2021S1/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.
- Loading branch information
1 parent
62f18c4
commit 3d99c23
Showing
5 changed files
with
30 additions
and
20 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,12 +1,17 @@ | ||
import java.time.LocalDate; | ||
import java.time.format.DateTimeFormatter; | ||
|
||
public class Deadline extends Task { | ||
String deadline; | ||
private final static DateTimeFormatter formatter = DateTimeFormatter.ofPattern("MMM dd yyyy"); | ||
LocalDate deadline; | ||
|
||
public Deadline(String description) { | ||
super(description.split(" /by ")[0]); | ||
this.deadline = description.split(" /by ")[1]; | ||
this.deadline = LocalDate.parse(description.split(" /by ")[1]); | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "[D][" + super.getStatusIcon() + "] " + super.description + " (by: " + this.deadline + ")"; | ||
return "[D][" + super.getStatusIcon() + "] " + super.description + " (by: " + this.deadline.format(formatter) + ")"; | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,17 @@ | ||
import java.time.LocalDate; | ||
import java.time.format.DateTimeFormatter; | ||
|
||
public class Event extends Task { | ||
String eventTime; | ||
private final static DateTimeFormatter formatter = DateTimeFormatter.ofPattern("MMM dd yyyy"); | ||
LocalDate eventTime; | ||
|
||
public Event(String description) { | ||
super(description.split(" /at ")[0]); | ||
this.eventTime = description.split(" /at ")[1]; | ||
this.eventTime = LocalDate.parse(description.split(" /at ")[1]); | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "[E][" + super.getStatusIcon() + "] " + super.description + " (at: " + this.eventTime + ")"; | ||
return "[E][" + super.getStatusIcon() + "] " + super.description + " (at: " + this.eventTime.format(formatter) + ")"; | ||
} | ||
} |
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