Skip to content

Commit

Permalink
Change Event and Deadline seperators to include /
Browse files Browse the repository at this point in the history
  • Loading branch information
glemenneo committed Oct 15, 2022
1 parent 6a37979 commit 3d46a1e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
12 changes: 6 additions & 6 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,16 @@ Now you have 1 tasks in the list.

Adds a Deadline task.

`deadline DESCRIPTION by YYYY-MM-DD HH:MM`
`deadline DESCRIPTION /by YYYY-MM-DD HH:MM`

Example of usage:

`deadline Assignment Submission by 2022-08-17 23:59`
`deadline Assignment Submission /by 2022-08-17 23:59`

Expected outcome:

```
deadline Assignment Submission by 2022-08-17 23:59
deadline Assignment Submission /by 2022-08-17 23:59
Got it. I've added this task:
[D][ ] Assignment Submission (by: Aug 17 2022 11:59PM)
Now you have 2 tasks in the list.
Expand All @@ -45,16 +45,16 @@ Now you have 2 tasks in the list.

Adds an Event task.

`event DESCRIPTION at YYYY-MM-DD HH:MM`
`event DESCRIPTION /at YYYY-MM-DD HH:MM`

Example of usage:

`event Dinner at 2022-08-19 18:00`
`event Dinner /at 2022-08-19 18:00`

Expected outcome:

```
event Dinner at 2022-08-19 18:00
event Dinner /at 2022-08-19 18:00
Got it. I've added this task:
[E][ ] Dinner (by: Aug 19 2022 06:00PM)
Now you have 3 tasks in the list.
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/duke/parser/Parser.java
Original file line number Diff line number Diff line change
Expand Up @@ -139,17 +139,17 @@ public String parseTask(String content, TaskType type)
return this.taskList.addToDo(content);

case DEADLINE:
if (!content.contains(" by ")) {
if (!content.contains(" /by ")) {
throw new DukeException("Formatting of deadline is incorrect.");
}
contents = content.split(" by ", 2);
contents = content.split(" /by ", 2);
break;

case EVENT:
if (!content.contains(" at ")) {
if (!content.contains(" /at ")) {
throw new DukeException("Formatting of event is incorrect.");
}
contents = content.split(" at ", 2);
contents = content.split(" /at ", 2);
break;

default:
Expand Down

0 comments on commit 3d46a1e

Please sign in to comment.