Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[clydelhui] iP #373

Open
wants to merge 32 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
556af3f
Add Gradle support
May 24, 2020
5ba595d
Modified Duke.java
clydelhui Jan 19, 2023
8dfc573
Modified Duke.java
clydelhui Jan 19, 2023
808b76a
Added Task.java and Modified Duke.java
clydelhui Jan 23, 2023
3e0e70a
Added new task types, modified Duke.java
clydelhui Jan 23, 2023
1222458
Added Text UI Testing
clydelhui Jan 23, 2023
75ff48e
Mofiy runtest.bat to compile packages, created exceptions to handle i…
clydelhui Jan 26, 2023
b8795a2
Modify Duke.java to include delete functionality
clydelhui Jan 26, 2023
d44382f
Add saving functionality, add CommandHandler and TaskList classes
clydelhui Jan 31, 2023
4a5cb95
Change type of Deadline to LocalDate
clydelhui Feb 1, 2023
4949ee8
Merge branch 'branch-Level-7'
clydelhui Feb 1, 2023
27e8322
Merge branch 'branch-Level-8'
clydelhui Feb 1, 2023
1a3fb0a
Add Ui, Storage, Parser, and Command classes.
clydelhui Feb 8, 2023
08bad31
Merge remote-tracking branch 'origin/add-gradle-support'
clydelhui Feb 10, 2023
d231c99
Add checkstyle to gradle, fix style issues, add JUnit tests for AddCo…
clydelhui Feb 14, 2023
6943842
Add new StorageException, JavaDocs
clydelhui Feb 15, 2023
7603704
Add new VoidCommand type "find"
clydelhui Feb 16, 2023
fc4f9e3
Modify files to fit coding standard
clydelhui Feb 16, 2023
9b4cc31
Merge branch 'branch-A-JavaDoc'
clydelhui Feb 16, 2023
0bf4219
Merge branch 'branch-A-CodingStandard'
clydelhui Feb 16, 2023
3572669
Merge branch 'branch-Level-9'
clydelhui Feb 16, 2023
cad9b7a
add UI with JavaFX
clydelhui Feb 17, 2023
fa95494
Merge branch 'branch-Level-10'
clydelhui Feb 17, 2023
ad01988
add assertions
clydelhui Feb 18, 2023
4f0e56a
Improve code quality
clydelhui Feb 19, 2023
640b3e3
Merge pull request #2 from clydelhui/branch-A-Assertions
clydelhui Feb 19, 2023
47cc6af
Merge branch 'master' of https://github.com/clydelhui/ip
clydelhui Feb 19, 2023
9c2d01f
Merge pull request #3 from clydelhui/branch-CodeQuality
clydelhui Feb 19, 2023
d908fae
add sort functionality, empty list exception
clydelhui Feb 20, 2023
b65a8e2
Merge branch 'branch-BCD-Extension'
clydelhui Feb 20, 2023
9d7b757
update README.md, make minor bug fixes
clydelhui Feb 20, 2023
81c5f59
Modify README.md
clydelhui Feb 21, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/main/java/CommandHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
import items.Task;
import items.ToDo;

import java.time.LocalDate;

public class CommandHandler {

private TaskList taskList;
Expand Down Expand Up @@ -50,7 +52,7 @@ public void execute(String command) throws IllegalCommandException,
}
case "deadline":
String[] paramsDeadline = parsedCommand[1].split("/");
Task newDeadline = new Deadline(paramsDeadline[0], paramsDeadline[1]);
Task newDeadline = new Deadline(paramsDeadline[0], LocalDate.parse(paramsDeadline[1]));
this.taskList.addTask(newDeadline);
break;
case "event":
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/Duke.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import java.io.File;
import java.io.IOException;
import java.time.LocalDate;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
Expand Down Expand Up @@ -39,8 +40,10 @@ public static void main(String[] args) {
while (true) {
input = usrInput.nextLine();
try {

commandHandler.execute(input);
} catch (IllegalInputException | IllegalCommandException e) {

System.out.println(e.toString());
}
}
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/TaskList.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import java.io.FileNotFoundException;
import java.io.FileWriter;
import java.io.IOException;
import java.time.LocalDate;
import java.util.ArrayList;
import java.util.Scanner;

Expand Down Expand Up @@ -110,7 +111,7 @@ private void refreshTaskList() throws FileNotFoundException {
this.taskList.add(new ToDo(parsedInput[1], isDone));
break;
case "D":
this.taskList.add(new Deadline(parsedInput[1], isDone, parsedInput[3]));
this.taskList.add(new Deadline(parsedInput[1], isDone, LocalDate.parse(parsedInput[3])));
break;
case "E":
this.taskList.add(new Event(parsedInput[1], isDone, parsedInput[3], parsedInput[4]));
Expand Down
8 changes: 5 additions & 3 deletions src/main/java/items/Deadline.java
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
package items;

import java.time.LocalDate;

public class Deadline extends Task{
private String endDate;
public Deadline(String description, String endDate) {
private LocalDate endDate;
public Deadline(String description, LocalDate endDate) {
super(description, "D");
this.endDate = endDate;
}

public Deadline(String description, boolean done, String endDate) {
public Deadline(String description, boolean done, LocalDate endDate) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

perhaps the parameter "done" could be changed to "isDone" instead!

super(description, "D", done);
this.endDate = endDate;
}
Expand Down