forked from nus-cs2103-AY2122S1/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
chongjunwei
committed
Sep 8, 2021
1 parent
f6aa489
commit 4a0dbbb
Showing
5 changed files
with
114 additions
and
18 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,4 +1,6 @@ | ||
T | 1 | read book | ||
D | 0 | return book | June 6th | ||
E | 0 | project meeting | Aug 6th 2-4pm | ||
D | 1 | return book | 2013-03-03 | ||
E | 0 | project meeting | 2012-01-03 | ||
T | 1 | join sports club | ||
D | 0 | return book | 2015-03-03 | ||
E | 1 | sleep | 2013-03-03 |
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,14 +1,21 @@ | ||
import java.time.LocalDate; | ||
import java.time.format.DateTimeFormatter; | ||
|
||
public class Deadline extends Task { | ||
|
||
protected String by; | ||
protected LocalDate time; | ||
|
||
public Deadline(String description, String by) { | ||
public Deadline(String description, LocalDate time) { | ||
super(description); | ||
this.by = by; | ||
this.time = time; | ||
} | ||
|
||
public String addToFile() { | ||
return "D | 0 | " + this.description + " | " + this.time; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "[D]" + super.toString() + " (by: " + by + ")"; | ||
return "[D]" + super.toString() + " (by: " + this.time.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,21 @@ | ||
import java.time.LocalDate; | ||
import java.time.format.DateTimeFormatter; | ||
|
||
public class Event extends Task { | ||
|
||
protected String at; | ||
protected LocalDate time; | ||
|
||
public Event(String description, String at) { | ||
public Event(String description, LocalDate time) { | ||
super(description); | ||
this.at = at; | ||
this.time = time; | ||
} | ||
|
||
public String addToFile() { | ||
return "E | 0 | " + this.description + " | " + this.time; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "[E]" + super.toString() + " (at: " + at + ")"; | ||
return "[E]" + super.toString() + " (at: " + this.time.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